MCPcopy Index your code
hub / github.com/python/cpython / test_networked_noverification

Method test_networked_noverification

Lib/test/test_httplib.py:2075–2087  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2073 self.assertEqual(exc_info.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
2074
2075 def test_networked_noverification(self):
2076 # Switch off cert verification
2077 import ssl
2078 support.requires('network')
2079 with socket_helper.transient_internet('self-signed.pythontest.net'):
2080 context = ssl._create_unverified_context()
2081 h = client.HTTPSConnection('self-signed.pythontest.net', 443,
2082 context=context)
2083 h.request('GET', '/')
2084 resp = h.getresponse()
2085 h.close()
2086 self.assertIn('nginx', resp.getheader('server'))
2087 resp.close()
2088
2089 @support.system_must_validate_cert
2090 def test_networked_trusted_by_default_cert(self):

Callers

nothing calls this directly

Calls 6

requiresMethod · 0.80
assertInMethod · 0.80
getheaderMethod · 0.80
requestMethod · 0.45
getresponseMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected