Skip to content

Instantly share code, notes, and snippets.

@fetus-hina
Last active April 6, 2018 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fetus-hina/b52609f3bfe992c917ab51c6ec8a9394 to your computer and use it in GitHub Desktop.
Save fetus-hina/b52609f3bfe992c917ab51c6ec8a9394 to your computer and use it in GitHub Desktop.
TLS Test
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import ssl
def http_get(url):
try:
requests.get(site["url"], verify=True)
return "OK"
except Exception as e:
# return e
return "Failed"
if __name__ == '__main__':
sites = [
{"label": "TLS v1.0 (Obsoleted) ", "url": "https://tls10.stat.ink/"},
{"label": "TLS v1.1 (Obsoleted) ", "url": "https://tls11.stat.ink/"},
{"label": "TLS v1.2 (Required) ", "url": "https://tls12.stat.ink/"},
{"label": "TLS v1.3 (Experimental)", "url": "https://tls13.stat.ink/"},
];
print("OpenSSL version: %s" % ssl.OPENSSL_VERSION)
for site in sites:
print("%s: %s" % (
site["label"],
http_get(site["url"])
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment