From a751b71eef7b1ba9698a43498406e78c04543605 Mon Sep 17 00:00:00 2001 From: mac12m99 Date: Mon, 25 Nov 2019 18:03:15 +0100 Subject: [PATCH] disabilitato check SSL --- core/httptools.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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