diff --git a/volatility3/framework/layers/resources.py b/volatility3/framework/layers/resources.py index 6083e795e..b9eae6634 100644 --- a/volatility3/framework/layers/resources.py +++ b/volatility3/framework/layers/resources.py @@ -139,18 +139,8 @@ 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: - vollog.warning( - "SSL certificate verification failed: attempting 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 non_verifying_ctx.verify_mode = ssl.CERT_NONE