diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-11-03 19:36:48 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-11-03 19:36:48 (GMT) |
commit | 1cca273669598978f6dfc1d1aad92e02a84bbe04 (patch) | |
tree | 1f691e61f1dcc13f14fee02fe0031dd865e74869 /Lib/test/test_urllib2_localnet.py | |
parent | 2cb0e73a89589ce56ba17da39a06f8017cfc92e4 (diff) | |
parent | 4ffb0752710f0c0720d4f2af0c4b7ce1ebb9d2bd (diff) | |
download | cpython-1cca273669598978f6dfc1d1aad92e02a84bbe04.zip cpython-1cca273669598978f6dfc1d1aad92e02a84bbe04.tar.gz cpython-1cca273669598978f6dfc1d1aad92e02a84bbe04.tar.bz2 |
merge 3.4 (#22417)
Diffstat (limited to 'Lib/test/test_urllib2_localnet.py')
-rw-r--r-- | Lib/test/test_urllib2_localnet.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py index d0a8a0f..e17b225 100644 --- a/Lib/test/test_urllib2_localnet.py +++ b/Lib/test/test_urllib2_localnet.py @@ -545,7 +545,8 @@ class TestUrlopen(unittest.TestCase): def test_https(self): handler = self.start_https_server() - data = self.urlopen("https://localhost:%s/bizarre" % handler.port) + context = ssl.create_default_context(cafile=CERT_localhost) + data = self.urlopen("https://localhost:%s/bizarre" % handler.port, context=context) self.assertEqual(data, b"we care a bit") def test_https_with_cafile(self): @@ -584,7 +585,8 @@ class TestUrlopen(unittest.TestCase): context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) context.set_servername_callback(cb_sni) handler = self.start_https_server(context=context, certfile=CERT_localhost) - self.urlopen("https://localhost:%s" % handler.port) + context = ssl.create_default_context(cafile=CERT_localhost) + self.urlopen("https://localhost:%s" % handler.port, context=context) self.assertEqual(sni_name, "localhost") def test_sending_headers(self): |