Allow TLS 1.2 and print error codes

An external developer reported that gclient sync fails on Windows 8.1
unless TLS 1.2 is explicitly enabled. This allows that security protocol
and prints a more detailed error message on failures.

Change-Id: I07ab832d4f922264a1ee1890f9b71949a313a7ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2480605
Commit-Queue: Anthony Polito <apolito@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
changes/05/2480605/2
Bruce Dawson 4 years ago committed by LUCI CQ
parent b3a1dbae30
commit bf66f2d5f6

@ -111,9 +111,13 @@ try {
$wc = (New-Object System.Net.WebClient)
$wc.Headers.Add("User-Agent", $UserAgent)
try {
# Download failures were reported on Windows 8.1 without this line.
[System.Net.ServicePointManager]::SecurityProtocol = `
[System.Net.SecurityProtocolType]::Tls12
$wc.DownloadFile($URL, $TmpPath)
} catch {
throw "Failed to download the file, check your network connection"
$err = $_.Exception.Message
throw "Failed to download the file, check your network connection, $err"
}
$ActualSHA256 = Get-Actual-SHA256 $TmpPath

Loading…
Cancel
Save