From f02c7490a4a123bbaaf7da35692f9309ecb5c0ea Mon Sep 17 00:00:00 2001 From: Jonathan Camara Date: Wed, 18 Dec 2019 10:19:22 -0600 Subject: [PATCH] fix TLS Error for windows agents --- lib/pe_build/cap/stage_installer/windows.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pe_build/cap/stage_installer/windows.rb b/lib/pe_build/cap/stage_installer/windows.rb index 834b76b..3aaa5a6 100644 --- a/lib/pe_build/cap/stage_installer/windows.rb +++ b/lib/pe_build/cap/stage_installer/windows.rb @@ -27,7 +27,7 @@ def self.stage_installer(machine, uri, dest_dir='.') on_machine(machine, <<-EOS) $DestDir = (Get-Item -Path "#{dest_dir}").FullName Write-Host "Downloading #{filename} to: ${DestDir}" - +[System.Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} (New-Object System.Net.WebClient).DownloadFile("#{uri}","$DestDir/#{filename}") EOS