Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dca213d

Browse files
committed
merge with 3.4
2 parents f253582 + fbaf931 commit dca213d

2 files changed

Lines changed: 24 additions & 12 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIChzCCAfCgAwIBAgIJAKGU95wKR8pSMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
3+
BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u
4+
IFNvZnR3YXJlIEZvdW5kYXRpb24xIzAhBgNVBAMMGnNlbGYtc2lnbmVkLnB5dGhv
5+
bnRlc3QubmV0MB4XDTE0MTEwMjE4MDkyOVoXDTI0MTAzMDE4MDkyOVowcDELMAkG
6+
A1UEBhMCWFkxFzAVBgNVBAcMDkNhc3RsZSBBbnRocmF4MSMwIQYDVQQKDBpQeXRo
7+
b24gU29mdHdhcmUgRm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0
8+
aG9udGVzdC5uZXQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANDXQXW9tjyZ
9+
Xt0Iv2tLL1+jinr4wGg36ioLDLFkMf+2Y1GL0v0BnKYG4N1OKlAU15LXGeGer8vm
10+
Sv/yIvmdrELvhAbbo3w4a9TMYQA4XkIVLdvu3mvNOAet+8PMJxn26dbDhG809ALv
11+
EHY57lQsBS3G59RZyBPVqAqmImWNJnVzAgMBAAGjKTAnMCUGA1UdEQQeMByCGnNl
12+
bGYtc2lnbmVkLnB5dGhvbnRlc3QubmV0MA0GCSqGSIb3DQEBBQUAA4GBAIOXmdtM
13+
eG9qzP9TiXW/Gc/zI4cBfdCpC+Y4gOfC9bQUC7hefix4iO3+iZjgy3X/FaRxUUoV
14+
HKiXcXIaWqTSUWp45cSh0MbwZXudp6JIAptzdAhvvCrPKeC9i9GvxsPD4LtDAL97
15+
vSaxQBezA7hdxZd90/EeyMgVZgAnTCnvAWX9
16+
-----END CERTIFICATE-----

Lib/test/test_httplib.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
CERT_localhost = os.path.join(here, 'keycert.pem')
1616
# Self-signed cert file for 'fakehostname'
1717
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')
2020

2121
# constants for testing chunked encoding
2222
chunked_start = (
@@ -1006,11 +1006,6 @@ def test_attributes(self):
10061006
h = client.HTTPSConnection(HOST, TimeoutTest.PORT, timeout=30)
10071007
self.assertEqual(h.timeout, 30)
10081008

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-
10141009
def test_networked(self):
10151010
# Default settings: requires a valid cert from a trusted CA
10161011
import ssl
@@ -1044,17 +1039,18 @@ def test_networked_trusted_by_default_cert(self):
10441039
self.assertIn('text/html', content_type)
10451040

10461041
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
10481043
import ssl
10491044
support.requires('network')
1050-
with support.transient_internet('svn.python.org'):
1045+
with support.transient_internet('self-signed.pythontest.net'):
10511046
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
10521047
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)
10551050
h.request('GET', '/')
10561051
resp = h.getresponse()
1057-
self._check_svn_python_org(resp)
1052+
server_string = resp.getheader('server')
1053+
self.assertIn('nginx', server_string)
10581054

10591055
def test_networked_bad_cert(self):
10601056
# We feed a "CA" cert that is unrelated to the server's cert

0 commit comments

Comments
 (0)