|
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 |
|
@@ -570,17 +570,18 @@ def test_networked(self): |
570 | 570 | self._check_svn_python_org(resp) |
571 | 571 |
|
572 | 572 | def test_networked_good_cert(self): |
573 | | - # We feed a CA cert that validates the server's cert |
| 573 | + # We feed the server's cert as a validating cert |
574 | 574 | import ssl |
575 | 575 | support.requires('network') |
576 | | - with support.transient_internet('svn.python.org'): |
| 576 | + with support.transient_internet('self-signed.pythontest.net'): |
577 | 577 | context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) |
578 | 578 | context.verify_mode = ssl.CERT_REQUIRED |
579 | | - context.load_verify_locations(CACERT_svn_python_org) |
580 | | - h = client.HTTPSConnection('svn.python.org', 443, context=context) |
| 579 | + context.load_verify_locations(CERT_selfsigned_pythontestdotnet) |
| 580 | + h = client.HTTPSConnection('self-signed.pythontest.net', 443, context=context) |
581 | 581 | h.request('GET', '/') |
582 | 582 | resp = h.getresponse() |
583 | | - self._check_svn_python_org(resp) |
| 583 | + server_string = resp.getheader('server') |
| 584 | + self.assertIn('nginx', server_string) |
584 | 585 |
|
585 | 586 | def test_networked_bad_cert(self): |
586 | 587 | # We feed a "CA" cert that is unrelated to the server's cert |
|
0 commit comments