diff options
| author | Alexander Karatarakis <alex@karatarakis.com> | 2018-02-22 18:02:24 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-22 18:02:24 -0800 |
| commit | 3b636f8d01844e70db6ae7ab773c218edbdde9e0 (patch) | |
| tree | 4d62a81e785ce6c773339358b8b42bfd7401ff43 /scripts | |
| parent | 4a25962307ae3317c94ce1e923ed8aea713931a3 (diff) | |
| parent | ce53ea00118154f240e7b5cb1856fd85b45dd216 (diff) | |
| download | vcpkg-3b636f8d01844e70db6ae7ab773c218edbdde9e0.tar.gz vcpkg-3b636f8d01844e70db6ae7ab773c218edbdde9e0.zip | |
Merge pull request #2863 from mcgoo/vswhere_github_tls_negotiation
use TLS 1.2 for downloads
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/VcpkgPowershellUtils.ps1 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1 index b73361fd1..d4296857e 100644 --- a/scripts/VcpkgPowershellUtils.ps1 +++ b/scripts/VcpkgPowershellUtils.ps1 @@ -120,11 +120,26 @@ function vcpkgDownloadFile( [Parameter(Mandatory=$true)][string]$url, return } + if ($url -match "github") + { + if ([System.Enum]::IsDefined([Net.SecurityProtocolType], "Tls12")) + { + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + } + else + { + Write-Warning "Github has dropped support for TLS versions prior to 1.2, which is not available on your system" + Write-Warning "Please manually download $url to $downloadPath" + throw "Download failed" + } + } + vcpkgCreateParentDirectoryIfNotExists $downloadPath $downloadPartPath = "$downloadPath.part" vcpkgRemoveItem $downloadPartPath + $wc = New-Object System.Net.WebClient if (!$wc.Proxy.IsBypassed($url)) { |
