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).
This commit is contained in:
Chris Johns 2015-03-29 15:35:00 +11:00
parent da801b07fa
commit 3237c8ee69

View File

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