Skip to content

Add TLS1.2 workaround for code coverage script #6299

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

Merged
merged 1 commit into from
Mar 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion test/tools/CodeCoverageAutomation/Start-CodeCoverageRun.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,16 @@ $jsonFile = "$outputBaseFolder\CC.json"

try
{
## Github needs TLS1.2 whereas the defaults for Invoke-WebRequest do not have TLS1.2
$prevSecProtocol = [System.Net.ServicePointManager]::SecurityProtocol

[System.Net.ServicePointManager]::SecurityProtocol =
[System.Net.ServicePointManager]::SecurityProtocol -bor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't or it with the existing setting. The SDL say 1.0 and newer at most.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default is TLS 1.0.

[System.Security.Authentication.SslProtocols]::Tls12 -bor
[System.Security.Authentication.SslProtocols]::Tls11

# first thing to do is to be sure that no processes are running which will cause us issues
Get-Process pwsh | Stop-Process -Force -ErrorAction Stop
Get-Process pwsh -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction Stop

## This is required so we do not keep on merging coverage reports.
if(Test-Path $outputLog)
Expand Down Expand Up @@ -337,6 +345,9 @@ catch
}
finally
{
## reset TLS1.2 settings.
[System.Net.ServicePointManager]::SecurityProtocol = $prevSecProtocol

# the powershell execution should be done, be sure that there are no PowerShell test executables running because
# they will cause subsequent coverage runs to behave poorly. Make sure that the path is properly formatted, and
# we need to use like rather than match because on Windows, there will be "\" as path separators which would need
Expand Down