-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed tls issues #6905
fixed tls issues #6905
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 3, | ||
"Patch": 2 | ||
"Patch": 3 | ||
}, | ||
"demands": [ | ||
"azureps" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 3, | ||
"Patch": 2 | ||
"Patch": 3 | ||
}, | ||
"demands": [ | ||
"azureps" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 0, | ||
"Patch": 112 | ||
"Patch": 113 | ||
}, | ||
"demands": [ | ||
"azureps" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 0, | ||
"Patch": 112 | ||
"Patch": 113 | ||
}, | ||
"demands": [ | ||
"azureps" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,20 @@ function Add-Tls12InSession { | |
param() | ||
|
||
try { | ||
if ([Net.ServicePointManager]::SecurityProtocol -notcontains 'Tls12') { | ||
[Net.ServicePointManager]::SecurityProtocol += [Net.SecurityProtocolType]3072 | ||
if ([Net.ServicePointManager]::SecurityProtocol.ToString().Split(',').Trim() -notcontains 'Tls12') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use the HasFlag() method of Enum class? The if condition would be: Refer: https://msdn.microsoft.com/en-us/library/system.enum.hasflag(v=vs.110).aspx There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hasFlag is available since .Net 4.0 only. Let's not take that dependency. |
||
$securityProtocol=@() | ||
$securityProtocol+=[Net.ServicePointManager]::SecurityProtocol | ||
$securityProtocol+=[Net.SecurityProtocolType]3072 | ||
[Net.ServicePointManager]::SecurityProtocol=$securityProtocol | ||
|
||
Write-Host (Get-VstsLocString -Key TLS12AddedInSession) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to expose this as a user facing message ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. We'll let the user know that we have added TLS 1.2 in session and that the network calls might use this protocol. |
||
} | ||
else { | ||
Write-Verbose 'TLS 1.2 already present in session.' | ||
} | ||
} | ||
catch { | ||
Write-VstsTaskError -Message (Get-VstsLocString -Key "UnableToAddTls12InSession" -ArgumentList $($_.Exception.Message)) | ||
Write-Host (Get-VstsLocString -Key "UnableToAddTls12InSession" -ArgumentList $($_.Exception.Message)) | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 1, | ||
"Patch": 28 | ||
"Patch": 29 | ||
}, | ||
"demands": [ | ||
"sqlpackage" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 1, | ||
"Patch": 28 | ||
"Patch": 29 | ||
}, | ||
"demands": [ | ||
"sqlpackage" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be tostring().Trim().split(',')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split(',').Trim() - this will trim invidual values. I think this is fine here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Ajay is right. This should be fine.