| --- a/Lib/test/test_urllib2_localnet.py Fri May 11 13:11:02 2012 -0400 |
| +++ b/Lib/test/test_urllib2_localnet.py Wed May 16 12:11:57 2012 -0700 |
| @@ -454,7 +454,7 @@ |
| def test_https(self): |
| handler = self.start_https_server() |
| - data = self.urlopen("https://localhost:%s/bizarre" % handler.port) |
| + data = self.urlopen("https://localhost:%s/bizarre" % handler.port, cadefault=False) |
| self.assertEqual(data, b"we care a bit") |
| def test_https_with_cafile(self): |
| @@ -474,6 +474,12 @@ |
| self.urlopen("https://localhost:%s/bizarre" % handler.port, |
| cafile=CERT_fakehostname) |
| + def test_https_with_cadefault(self): |
| + handler = self.start_https_server(certfile=CERT_localhost) |
| + # Self-signed cert should fail verification with system certificate store |
| + with self.assertRaises(urllib.error.URLError) as cm: |
| + self.urlopen("https://localhost:%s/bizarre" % handler.port) |
| + |
| def test_sending_headers(self): |
| handler = self.start_server() |
| req = urllib.request.Request("http://localhost:%s/" % handler.port, |