mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-11-21 15:41:54 +00:00
Fix for --auth-file (PKI) failing on self-signed/internal CA certificates
This commit is contained in:
parent
175dc5dfa4
commit
9d5259ff98
2 changed files with 4 additions and 1 deletions
|
|
@ -37,6 +37,9 @@ class HTTPSPKIAuthHandler(_urllib.request.HTTPSHandler):
|
|||
try:
|
||||
if ssl and hasattr(ssl, "SSLContext") and hasattr(ssl, "create_default_context"):
|
||||
ctx = ssl.create_default_context()
|
||||
# Note: no server certificate validation (e.g. self-signed/internal CA), as everywhere else (e.g. httpshandler.py)
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
ctx.load_cert_chain(certfile=self.auth_file, keyfile=self.auth_file)
|
||||
try:
|
||||
return _http_client.HTTPSConnection(host, timeout=timeout, context=ctx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue