From bedd0a11bacd83d89d09dfe805a3c44da982a895 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 10 Feb 2015 17:52:33 +0800 Subject: [PATCH] Suppress SSL verification, fixes #1115 --- script/lib/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/lib/util.py b/script/lib/util.py index c6f07cea7322..1c4f26b76ad5 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -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