Skip to content

Commit f558379

Browse files
paxri01paxri01
andauthored
Update PROTOCOL_TLS to PROTOCOL_TLS_CLIENT (jarun#426)
Co-authored-by: paxri01 <rick.pub1@blowphish.net>
1 parent 6e6bcdd commit f558379

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

googler

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,12 @@ class HardenedHTTPSConnection(HTTPSConnection):
16061606
elif not notweak:
16071607
# Try to use TLS 1.2
16081608
ssl_context = None
1609-
if hasattr(ssl, 'PROTOCOL_TLS'):
1609+
if hasattr(ssl, 'PROTOCOL_TLS_CLIENT'):
1610+
# Since Python 3.6
1611+
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
1612+
ssl_context.check_hostname = False
1613+
ssl_context.verify_mode = ssl.CERT_NONE
1614+
elif hasattr(ssl, 'PROTOCOL_TLS'):
16101615
# Since Python 3.5.3
16111616
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
16121617
if hasattr(ssl_context, "minimum_version"):

0 commit comments

Comments
 (0)