[rtems-source-builder commit] sb: Provide an unverified SSL context to the URL.

Chris Johns chrisj at rtems.org
Sun Mar 29 04:37:24 UTC 2015


Module:    rtems-source-builder
Branch:    master
Commit:    3237c8ee69d7398c3d2ccade9879a3dde7785db1
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=3237c8ee69d7398c3d2ccade9879a3dde7785db1

Author:    Chris Johns <chrisj at rtems.org>
Date:      Sun Mar 29 15:35:00 2015 +1100

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')



More information about the vc mailing list