From b8959065e3378f98dad718aeefd4464b451b6bd0 Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Fri, 23 Sep 2022 00:59:21 +0900 Subject: [PATCH] Fix: ssl error for python37 --- volatility3/framework/layers/resources.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/volatility3/framework/layers/resources.py b/volatility3/framework/layers/resources.py index dca215c85..4a3bd279a 100644 --- a/volatility3/framework/layers/resources.py +++ b/volatility3/framework/layers/resources.py @@ -120,11 +120,7 @@ class ResourceAccessor(object): fp = urllib.request.urlopen(url, context = self._context) except error.URLError as excp: if excp.args: - # TODO: As of python3.7 this can be removed - unverified_retrieval = (hasattr(ssl, "SSLCertVerificationError") and isinstance( - excp.args[0], ssl.SSLCertVerificationError)) or (isinstance(excp.args[0], ssl.SSLError) and - excp.args[0].reason == "CERTIFICATE_VERIFY_FAILED") - if unverified_retrieval: + if isinstance(excp.args[0], ssl.SSLCertVerificationError): vollog.warning("SSL certificate verification failed: attempting UNVERIFIED retrieval") non_verifying_ctx = ssl.SSLContext() non_verifying_ctx.check_hostname = False