From 85de1d64f70adfb02053f74b3a5df7c5f1235ecf Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 19 Jun 2020 08:49:35 -0700 Subject: [PATCH] Enable TLS1.2 in the generatenupkg step (#7833) --- .../targets/packaging/windows/clisdk/generatenupkg.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/redist/targets/packaging/windows/clisdk/generatenupkg.ps1 b/src/redist/targets/packaging/windows/clisdk/generatenupkg.ps1 index 9b33b4056..e52b9d11e 100644 --- a/src/redist/targets/packaging/windows/clisdk/generatenupkg.ps1 +++ b/src/redist/targets/packaging/windows/clisdk/generatenupkg.ps1 @@ -11,6 +11,8 @@ param( [Parameter(Mandatory=$false)][string]$MmVersion ) +[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bOR [Net.SecurityProtocolType]::Tls12 + $NuGetDir = Join-Path $BinDir "nuget" $NuGetExe = Join-Path $NuGetDir "nuget.exe" $OutputDirectory = [System.IO.Path]::GetDirectoryName($NupkgFile) @@ -29,6 +31,11 @@ if (-not (Test-Path $NuGetExe)) { wget https://dist.nuget.org/win-x86-commandline/v3.5.0/nuget.exe -OutFile $NuGetExe } +if (-not (Test-Path $NuGetExe)) { + Write-Error "Could not download nuget.exe" + Exit 1 +} + if (Test-Path $NupkgFile) { Remove-Item -Force $NupkgFile }