From 3237c8ee69d7398c3d2ccade9879a3dde7785db1 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Sun, 29 Mar 2015 15:35:00 +1100 Subject: [PATCH] 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). --- source-builder/sb/download.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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')