Last active
April 6, 2018 13:46
-
-
Save fetus-hina/b52609f3bfe992c917ab51c6ec8a9394 to your computer and use it in GitHub Desktop.
TLS Test
This file contains 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
#!/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