diff --git a/tests/net_inet/test_tls_sites.py b/tests/net_inet/test_tls_sites.py index 67345fd0b9..bf8071d087 100644 --- a/tests/net_inet/test_tls_sites.py +++ b/tests/net_inet/test_tls_sites.py @@ -6,6 +6,8 @@ try: import ussl as ssl except: import ssl + # CPython only supports server_hostname with SSLContext + ssl = ssl.SSLContext() def test_one(site, opts): @@ -22,7 +24,7 @@ def test_one(site, opts): else: s = ssl.wrap_socket(s) - s.write(b"GET / HTTP/1.0\r\n\r\n") + s.write(b"GET / HTTP/1.0\r\nHost: %s\r\n\r\n" % bytes(site, 'latin')) resp = s.read(4096) # print(resp) @@ -34,6 +36,7 @@ SITES = [ "google.com", "www.google.com", "api.telegram.org", + {"host": "api.pushbullet.com", "sni": True}, # "w9rybpfril.execute-api.ap-southeast-2.amazonaws.com", {"host": "w9rybpfril.execute-api.ap-southeast-2.amazonaws.com", "sni": True}, ] diff --git a/tests/net_inet/test_tls_sites.py.exp b/tests/net_inet/test_tls_sites.py.exp index 12732d1fa5..2f3c113d2f 100644 --- a/tests/net_inet/test_tls_sites.py.exp +++ b/tests/net_inet/test_tls_sites.py.exp @@ -1,4 +1,5 @@ google.com ok www.google.com ok api.telegram.org ok +api.pushbullet.com ok w9rybpfril.execute-api.ap-southeast-2.amazonaws.com ok