summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bitbake/lib/bb/fetch2/wget.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 7e90efb4df..545f02dcf0 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -238,7 +238,22 @@ class Wget(FetchMethod):
238 return "HEAD" 238 return "HEAD"
239 239
240 exported_proxies = export_proxies(d) 240 exported_proxies = export_proxies(d)
241 if exported_proxies == True: 241
242 # XXX: Since Python 2.7.9 ssl cert validation is enabled by default
243 # see PEP-0476, this causes verification errors on some https servers
244 # so disable by default.
245 import ssl
246 ssl_context = None
247 if hasattr(ssl, '_create_unverified_context'):
248 ssl_context = ssl._create_unverified_context()
249
250 if exported_proxies == True and ssl_context is not None:
251 opener = urllib2.build_opener(urllib2.ProxyHandler, CacheHTTPHandler,
252 urllib2.HTTPSHandler(context=ssl_context))
253 elif exported_proxies == False and ssl_context is not None:
254 opener = urllib2.build_opener(CacheHTTPHandler,
255 urllib2.HTTPSHandler(context=ssl_context))
256 elif exported_proxies == True and ssl_context is None:
242 opener = urllib2.build_opener(urllib2.ProxyHandler, CacheHTTPHandler) 257 opener = urllib2.build_opener(urllib2.ProxyHandler, CacheHTTPHandler)
243 else: 258 else:
244 opener = urllib2.build_opener(CacheHTTPHandler) 259 opener = urllib2.build_opener(CacheHTTPHandler)
@@ -247,8 +262,9 @@ class Wget(FetchMethod):
247 urllib2.install_opener(opener) 262 urllib2.install_opener(opener)
248 263
249 uri = ud.url.split(";")[0] 264 uri = ud.url.split(";")[0]
265
250 try: 266 try:
251 f = urllib2.urlopen(uri) 267 urllib2.urlopen(uri)
252 except: 268 except:
253 return False 269 return False
254 return True 270 return True