diff options
| -rw-r--r-- | examples/network/https_client.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/network/https_client.py b/examples/network/https_client.py index d20f283d7..60ceb83c7 100644 --- a/examples/network/https_client.py +++ b/examples/network/https_client.py @@ -32,7 +32,10 @@ def main(domain, addr_family=0, use_stream=True): s.connect(addr) # Upgrade the socket to a TLS connection. - s = ssl.wrap_socket(s) + ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + ctx.check_hostname = False + ctx.verify_mode = ssl.CERT_NONE + s = ctx.wrap_socket(s) print(s) # Send request and read response. |
