diff --git a/core/httptools.py b/core/httptools.py index 31889c9d..7edc128c 100644 --- a/core/httptools.py +++ b/core/httptools.py @@ -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: +# [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