Created
October 12, 2016 15:57
-
-
Save hoov/eaa2dbad086cfc38bb6aedeb5adeb918 to your computer and use it in GitHub Desktop.
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 | |
import httplib | |
import urllib2 | |
import requests | |
def trace(s, *n): | |
print(str(s) % n) | |
def test_tls(): | |
url = "https://www.emulate.io" | |
url = "https://tls1test.salesforce.com" | |
trace("Trying urllib2") | |
urllib2.urlopen(url).read() | |
trace("Trying httplib") | |
conn = httplib.HTTPSConnection("www.emulate.io", strict=True) | |
conn.request("GET", "/") | |
resp = conn.getresponse() | |
print(resp.read()) | |
trace("Trying requests") | |
requests.get(url, verify=True) | |
if __name__ == "__main__": | |
test_tls() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment