Answer the question
In order to leave comments, you need to log in
OpenSSL python ssl functions not working?
The code:
import ssl,socket
print(ssl.OPENSSL_VERSION)
s = socket.socket(2,1)
s.connect(("g.co", 443))
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
ctx.set_ciphers("ECDHE-RSA-AES256-GCM-SHA384")
ctx.verify_mode = ssl.CERT_REQUIRED
ctx.check_hostname = True
ctx.load_default_certs()
ctx.set_npn_protocols(['h2-14'])
c = ctx.wrap_socket(s, server_hostname="g.co",do_handshake_on_connect=False)
c.do_handshake()
print(c.selected_npn_protocol())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question