summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-07-08 18:34:21 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-12 22:50:44 +0100
commit5ae52eec3a14322ef0f4b4d3759bac3eaa62f0fc (patch)
tree9b312c73d04ab435c7d2b9627cb7a42c82cb1f35 /bitbake/lib/bb
parent73b9cd9764c9838913c7c57eec220e4176ed2b7d (diff)
downloadpoky-5ae52eec3a14322ef0f4b4d3759bac3eaa62f0fc.tar.gz
bitbake: fetch2/wget.py: checkstatus disable SSL cert validation.
Since Python 2.7.9 ssl cert validation is enabled by default see PEP-0476, this causes verification errors on some https servers so disable by default. (Bitbake rev: e177170200ece76b36e3f7d5597651fdef67736f) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-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