MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_networked_noverification

Method test_networked_noverification

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

Source from the content-addressed store, hash-verified

2027 self.assertEqual(exc_info.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
2028
2029 def test_networked_noverification(self):
2030 # Switch off cert verification
2031 import ssl
2032 support.requires('network')
2033 with socket_helper.transient_internet('self-signed.pythontest.net'):
2034 context = ssl._create_unverified_context()
2035 h = client.HTTPSConnection('self-signed.pythontest.net', 443,
2036 context=context)
2037 h.request('GET', '/')
2038 resp = h.getresponse()
2039 h.close()
2040 self.assertIn('nginx', resp.getheader('server'))
2041 resp.close()
2042
2043 @support.system_must_validate_cert
2044 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