Skip to content

Instantly share code, notes, and snippets.

@charleswhchan
Created March 4, 2021 22:50
Show Gist options
  • Save charleswhchan/f3228181d5d943b1a5d52751940a9605 to your computer and use it in GitHub Desktop.
Save charleswhchan/f3228181d5d943b1a5d52751940a9605 to your computer and use it in GitHub Desktop.
Check TLS version used by Python
import json
import urllib.request
with urllib.request.urlopen('http://www.howsmyssl.com/a/check') as response:
response = response.read()
data = json.loads(response.decode())
tls_version = data["tls_version"]
print(tls_version)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment