Last active
August 29, 2015 13:56
-
-
Save westhood/8971012 to your computer and use it in GitHub Desktop.
Use npn to test if the site supports spdy protocol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ssl | |
| import socket | |
| context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) | |
| context.set_npn_protocols(["http/1.1", "spdy/3"]) | |
| sock = socket.socket() | |
| ssl_sock = context.wrap_socket(sock) | |
| ssl_sock.connect(("www.google.com", 443)) | |
| print(ssl_sock.selected_npn_protocol()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment