mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-10 03:37:39 +02:00
Merge pull request #839 from digitalisx/fix/ssl-error-for-python37
Fix: unverified retrieval SSL Error for Python `3.7`.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user