mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +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:
committed by
Richard Purdie
parent
73b9cd9764
commit
5ae52eec3a
@@ -238,7 +238,22 @@ class Wget(FetchMethod):
|
|||||||
return "HEAD"
|
return "HEAD"
|
||||||
|
|
||||||
exported_proxies = export_proxies(d)
|
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)
|
opener = urllib2.build_opener(urllib2.ProxyHandler, CacheHTTPHandler)
|
||||||
else:
|
else:
|
||||||
opener = urllib2.build_opener(CacheHTTPHandler)
|
opener = urllib2.build_opener(CacheHTTPHandler)
|
||||||
@@ -247,8 +262,9 @@ class Wget(FetchMethod):
|
|||||||
urllib2.install_opener(opener)
|
urllib2.install_opener(opener)
|
||||||
|
|
||||||
uri = ud.url.split(";")[0]
|
uri = ud.url.split(";")[0]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
f = urllib2.urlopen(uri)
|
urllib2.urlopen(uri)
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user