summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2015-03-30 14:30:56 +1100
committerChris Johns <chrisj@rtems.org>2015-03-30 14:30:56 +1100
commitbd16849b11c8422cccaa52500b7badb9c6dd7086 (patch)
treee1ed0ca615edd55bd38d96d195b7df18c1fde5cb
parentsb: Provide an unverified SSL context to the URL. (diff)
downloadrtems-source-builder-bd16849b11c8422cccaa52500b7badb9c6dd7086.tar.bz2
sb: Update the downloader for 2.7.8 and earlier without a context.
-rw-r--r--source-builder/sb/download.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index 032e3ae..5622d4a 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -328,9 +328,11 @@ def _http_downloader(url, local, config, opts):
try:
import ssl
_ssl_context = ssl._create_unverified_context()
+ _in = urllib2.urlopen(url, context = _ssl_context)
except:
- pass
- _in = urllib2.urlopen(url, context = _ssl_context)
+ _ssl_context = None
+ if _ssl_context is None:
+ _in = urllib2.urlopen(url)
if url != _in.geturl():
log.notice(' redirect: %s' % (_in.geturl()))
_out = open(path.host(local), 'wb')