1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

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>
This commit is contained in:
Aníbal Limón
2015-07-08 18:34:21 -05:00
committed by Richard Purdie
parent 73b9cd9764
commit 5ae52eec3a
+18 -2
View File
@@ -238,7 +238,22 @@ class Wget(FetchMethod):
return "HEAD"
exported_proxies = export_proxies(d)
if exported_proxies == True:
# XXX: 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.
import ssl
ssl_context = None
if hasattr(ssl, '_create_unverified_context'):
ssl_context = ssl._create_unverified_context()
if exported_proxies == True and ssl_context is not None:
opener = urllib2.build_opener(urllib2.ProxyHandler, CacheHTTPHandler,
urllib2.HTTPSHandler(context=ssl_context))
elif exported_proxies == False and ssl_context is not None:
opener = urllib2.build_opener(CacheHTTPHandler,
urllib2.HTTPSHandler(context=ssl_context))
elif exported_proxies == True and ssl_context is None:
opener = urllib2.build_opener(urllib2.ProxyHandler, CacheHTTPHandler)
else:
opener = urllib2.build_opener(CacheHTTPHandler)
@@ -247,8 +262,9 @@ class Wget(FetchMethod):
urllib2.install_opener(opener)
uri = ud.url.split(";")[0]
try:
f = urllib2.urlopen(uri)
urllib2.urlopen(uri)
except:
return False
return True