Skip to content

Commit ff06c9d

Browse files
authored
Rollup merge of #55840 - dlrobertson:fix_stage0_download, r=alexcrichton
Fix TLS errors when downloading stage0 While attempting to test #49878 on Windows I hit the following error when attempting to download stage0. ``` The request was aborted: Could not create SSL/TLS secure channel ``` Instead of using the shell, we can just use `urllib`, which seems to fix the issue.
2 parents 68afefc + c211238 commit ff06c9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bootstrap/bootstrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def _download(path, url, probably_big, verbose, exception):
7979
# see http://serverfault.com/questions/301128/how-to-download
8080
if sys.platform == 'win32':
8181
run(["PowerShell.exe", "/nologo", "-Command",
82-
"(New-Object System.Net.WebClient)"
83-
".DownloadFile('{}', '{}')".format(url, path)],
82+
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;",
83+
"(New-Object System.Net.WebClient).DownloadFile('{}', '{}')".format(url, path)],
8484
verbose=verbose,
8585
exception=exception)
8686
else:

0 commit comments

Comments
 (0)