|
15 | 15 | CERT_localhost = os.path.join(here, 'keycert.pem') |
16 | 16 | # Self-signed cert file for 'fakehostname' |
17 | 17 | CERT_fakehostname = os.path.join(here, 'keycert2.pem') |
18 | | -# Root cert file (CA) for svn.python.org's cert |
19 | | -CACERT_svn_python_org = os.path.join(here, 'https_svn_python_org_root.pem') |
| 18 | +# Self-signed cert file for self-signed.pythontest.net |
| 19 | +CERT_selfsigned_pythontestdotnet = os.path.join(here, 'selfsigned_pythontestdotnet.pem') |
20 | 20 |
|
21 | 21 | # constants for testing chunked encoding |
22 | 22 | chunked_start = ( |
@@ -1006,11 +1006,6 @@ def test_attributes(self): |
1006 | 1006 | h = client.HTTPSConnection(HOST, TimeoutTest.PORT, timeout=30) |
1007 | 1007 | self.assertEqual(h.timeout, 30) |
1008 | 1008 |
|
1009 | | - def _check_svn_python_org(self, resp): |
1010 | | - # Just a simple check that everything went fine |
1011 | | - server_string = resp.getheader('server') |
1012 | | - self.assertIn('Apache', server_string) |
1013 | | - |
1014 | 1009 | def test_networked(self): |
1015 | 1010 | # Default settings: requires a valid cert from a trusted CA |
1016 | 1011 | import ssl |
@@ -1044,17 +1039,18 @@ def test_networked_trusted_by_default_cert(self): |
1044 | 1039 | self.assertIn('text/html', content_type) |
1045 | 1040 |
|
1046 | 1041 | def test_networked_good_cert(self): |
1047 | | - # We feed a CA cert that validates the server's cert |
| 1042 | + # We feed the server's cert as a validating cert |
1048 | 1043 | import ssl |
1049 | 1044 | support.requires('network') |
1050 | | - with support.transient_internet('svn.python.org'): |
| 1045 | + with support.transient_internet('self-signed.pythontest.net'): |
1051 | 1046 | context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) |
1052 | 1047 | context.verify_mode = ssl.CERT_REQUIRED |
1053 | | - context.load_verify_locations(CACERT_svn_python_org) |
1054 | | - h = client.HTTPSConnection('svn.python.org', 443, context=context) |
| 1048 | + context.load_verify_locations(CERT_selfsigned_pythontestdotnet) |
| 1049 | + h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context) |
1055 | 1050 | h.request('GET', '/') |
1056 | 1051 | resp = h.getresponse() |
1057 | | - self._check_svn_python_org(resp) |
| 1052 | + server_string = resp.getheader('server') |
| 1053 | + self.assertIn('nginx', server_string) |
1058 | 1054 |
|
1059 | 1055 | def test_networked_bad_cert(self): |
1060 | 1056 | # We feed a "CA" cert that is unrelated to the server's cert |
|
0 commit comments