]> khamidou — GitHub mirrors - electron.git/commitdiff
Suppress SSL verification, fixes #1115
authorCheng Zhao <zcbenz@gmail.com>
Tue, 10 Feb 2015 09:52:33 +0000 (17:52 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 10 Feb 2015 09:52:33 +0000 (17:52 +0800)
script/lib/util.py

index c6f07cea7322e905dfe8c0165ff4c9be312b71da..1c4f26b76ad5728d8f1d150d8a1b5f5f765484fc 100644 (file)
@@ -4,6 +4,7 @@ import atexit
 import contextlib
 import errno
 import shutil
+import ssl
 import subprocess
 import sys
 import tarfile
@@ -45,6 +46,9 @@ def scoped_env(key, value):
 def download(text, url, path):
   safe_mkdir(os.path.dirname(path))
   with open(path, 'wb') as local_file:
+    if hasattr(ssl, '_create_unverified_context'):
+      ssl._create_default_https_context = ssl._create_unverified_context
+
     web_file = urllib2.urlopen(url)
     file_size = int(web_file.info().getheaders("Content-Length")[0])
     downloaded_size = 0