diff options
author | Chris Johns <chrisj@rtems.org> | 2015-03-29 15:35:00 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2015-03-29 15:35:00 +1100 |
commit | 3237c8ee69d7398c3d2ccade9879a3dde7785db1 (patch) | |
tree | 10db4fde905ff4a012949c4aef2989c682d8f9ab /source-builder/sb/download.py | |
parent | rtems: Change the base URL for RTEMS git to https to avoid the redirects. (diff) | |
download | rtems-source-builder-3237c8ee69d7398c3d2ccade9879a3dde7785db1.tar.bz2 |
sb: Provide an unverified SSL context to the URL.
The RTEMS servers are causing an exception when downloading patches. The solution is
provided in PEP-0476 (https://www.python.org/dev/peps/pep-0476/#opting-out).
Diffstat (limited to 'source-builder/sb/download.py')
-rw-r--r-- | source-builder/sb/download.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py index 16aa251..032e3ae 100644 --- a/source-builder/sb/download.py +++ b/source-builder/sb/download.py @@ -324,7 +324,13 @@ def _http_downloader(url, local, config, opts): try: try: _in = None - _in = urllib2.urlopen(url) + _ssl_context = None + try: + import ssl + _ssl_context = ssl._create_unverified_context() + except: + pass + _in = urllib2.urlopen(url, context = _ssl_context) if url != _in.geturl(): log.notice(' redirect: %s' % (_in.geturl())) _out = open(path.host(local), 'wb') |