|
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 | HOST = support.HOST
|
22 | 22 |
|
@@ -772,11 +772,6 @@ def test_attributes(self):
|
772 | 772 | h = client.HTTPSConnection(HOST, TimeoutTest.PORT, timeout=30)
|
773 | 773 | self.assertEqual(h.timeout, 30)
|
774 | 774 |
|
775 |
| - def _check_svn_python_org(self, resp): |
776 |
| - # Just a simple check that everything went fine |
777 |
| - server_string = resp.getheader('server') |
778 |
| - self.assertIn('Apache', server_string) |
779 |
| - |
780 | 775 | def test_networked(self):
|
781 | 776 | # Default settings: requires a valid cert from a trusted CA
|
782 | 777 | import ssl
|
@@ -810,17 +805,18 @@ def test_networked_trusted_by_default_cert(self):
|
810 | 805 | self.assertIn('text/html', content_type)
|
811 | 806 |
|
812 | 807 | def test_networked_good_cert(self):
|
813 |
| - # We feed a CA cert that validates the server's cert |
| 808 | + # We feed the server's cert as a validating cert |
814 | 809 | import ssl
|
815 | 810 | support.requires('network')
|
816 |
| - with support.transient_internet('svn.python.org'): |
| 811 | + with support.transient_internet('self-signed.pythontest.net'): |
817 | 812 | context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
|
818 | 813 | context.verify_mode = ssl.CERT_REQUIRED
|
819 |
| - context.load_verify_locations(CACERT_svn_python_org) |
820 |
| - h = client.HTTPSConnection('svn.python.org', 443, context=context) |
| 814 | + context.load_verify_locations(CERT_selfsigned_pythontestdotnet) |
| 815 | + h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context) |
821 | 816 | h.request('GET', '/')
|
822 | 817 | resp = h.getresponse()
|
823 |
| - self._check_svn_python_org(resp) |
| 818 | + server_string = resp.getheader('server') |
| 819 | + self.assertIn('nginx', server_string) |
824 | 820 |
|
825 | 821 | def test_networked_bad_cert(self):
|
826 | 822 | # We feed a "CA" cert that is unrelated to the server's cert
|
|
0 commit comments