disabilitato check SSL

This commit is contained in:
mac12m99
2019-11-25 18:03:15 +01:00
committed by marco
parent 925e1d256f
commit a751b71eef

View File

@@ -4,6 +4,23 @@
# Based on code from https://github.com/alfa-addon/
# --------------------------------------------------------------------------------
# Fix para error de validación del certificado del tipo:
# [downloadpage] Response code: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)>
# [downloadpage] Response error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661)
# Fix desde la página: https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error
# -----------------------------------------------------------------------
import ssl
try:
_create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
# Legacy Python that doesn't verify HTTPS certificates by default
pass
else:
# Handle target environment that doesn't support HTTPS verification
ssl._create_default_https_context = _create_unverified_https_context
# -----------------------------------------------------------------------
try:
import urllib.request as urllib
import urllib.parse as urlparse