Skip to content

Commit 22ee0e4

Browse files
authored
Users/shreyas r msft/tls fix142port (#8766)
* fixed tls fix * removed some unneccessary changes
1 parent 3b00d5a commit 22ee0e4

File tree

12 files changed

+34
-29
lines changed

12 files changed

+34
-29
lines changed

Tasks/QuickPerfTestV1/Invoke-QuickPerfTest.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ function ValidatePatToken($token)
6464
}
6565
}
6666

67-
# Force powershell to use TLS 1.2 for all communications
68-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls12;
69-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls11;
70-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls10;
67+
try {
68+
# Force powershell to use TLS 1.2 for all communications.
69+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls10;
70+
}
71+
catch {
72+
Write-Warning $error
73+
}
7174

7275
# Load all dependent files for execution
7376
. $PSScriptRoot/CltTasksUtility.ps1

Tasks/QuickPerfTestV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 33
16+
"Patch": 35
1717
},
1818
"demands": [
1919
"msbuild",

Tasks/QuickPerfTestV1/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 33
16+
"Patch": 35
1717
},
1818
"demands": [
1919
"msbuild",

Tasks/RunJMeterLoadTestV1/Start-ApacheJMeterTest.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@ else {
3434
$global:RestTimeout = 60
3535
$global:apiVersion = "api-version=1.0"
3636

37-
# Force powershell to use TLS 1.2 for all communications
38-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls12;
39-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls11;
40-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls10;
37+
try {
38+
# Force powershell to use TLS 1.2 for all communications.
39+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls10;
40+
}
41+
catch {
42+
Write-Warning $error
43+
}
4144

4245
function InitializeRestHeaders()
4346
{

Tasks/RunJMeterLoadTestV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 25
16+
"Patch": 27
1717
},
1818
"demands": [
1919
"azureps"

Tasks/RunJMeterLoadTestV1/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 25
16+
"Patch": 27
1717
},
1818
"demands": [
1919
"azureps"

Tasks/RunLoadTestV1/Start-CloudLoadTest.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ else {
3939
$userAgent = "CloudLoadTestReleaseTask"
4040
}
4141

42-
# Force powershell to use TLS 1.2 for all communications
43-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls12;
44-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls11;
45-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls10;
42+
try {
43+
# Force powershell to use TLS 1.2 for all communications.
44+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls10;
45+
}
46+
catch {
47+
Write-Warning $error
48+
}
4649

4750
$global:apiVersion = "api-version=1.0"
4851
$global:ScopedTestDrop = $TestDrop

Tasks/RunLoadTestV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 32
16+
"Patch": 34
1717
},
1818
"demands": [
1919
"msbuild",

Tasks/RunLoadTestV1/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 32
16+
"Patch": 34
1717
},
1818
"demands": [
1919
"msbuild",

Tasks/VsTestV1/VSTest.ps1

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,12 @@ Write-Verbose "configuration = $configuration"
3434
Write-Verbose "publishRunAttachments = $publishRunAttachments"
3535
Write-Verbose "vstestLocation = $vstestLocation"
3636

37-
try
38-
{
39-
# Force powershell to use TLS 1.2 for all communications
40-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls12
41-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls11
42-
[System.Net.ServicePointManager]::SecurityProtocol += [System.Net.SecurityProtocolType]::Tls10
37+
try {
38+
# Force powershell to use TLS 1.2 for all communications.
39+
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor [System.Net.SecurityProtocolType]::Tls12 -bor [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls10;
4340
}
44-
catch
45-
{
46-
Write-Verbose "Failed to set SecurityProtocol to use TLS 1.2 by default"
41+
catch {
42+
Write-Warning $error
4743
}
4844

4945
# Import the Task.Common and Task.Internal dll that has all the cmdlets we need for Build

0 commit comments

Comments
 (0)