about summary refs log tree commit diff
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-11-13 13:03:11 +0800
committerkennytm <kennytm@gmail.com>2018-11-13 19:20:33 +0800
commit5b572fb84020f9451cff3512826880272fbd686a (patch)
tree11540ef49a45d2ac8623e3cd95e3d1772866a517
parentf73df10c3912a82849b05a6338a94a10732a4882 (diff)
parentc21123818096f599a9f394cd8a1072228d1f1a54 (diff)
downloadrust-5b572fb84020f9451cff3512826880272fbd686a.tar.gz
rust-5b572fb84020f9451cff3512826880272fbd686a.zip
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.
-rw-r--r--src/bootstrap/bootstrap.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index fdd8784453b..cd48e6aa4c4 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -79,8 +79,8 @@ def _download(path, url, probably_big, verbose, exception):
     # see http://serverfault.com/questions/301128/how-to-download
     if sys.platform == 'win32':
         run(["PowerShell.exe", "/nologo", "-Command",
-             "(New-Object System.Net.WebClient)"
-             ".DownloadFile('{}', '{}')".format(url, path)],
+             "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;",
+             "(New-Object System.Net.WebClient).DownloadFile('{}', '{}')".format(url, path)],
             verbose=verbose,
             exception=exception)
     else: