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

Method test_get_ca_certs_capath

Lib/test/test_ssl.py:2312–2322  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2310 s.connect(self.server_addr)
2311
2312 def test_get_ca_certs_capath(self):
2313 # capath certs are loaded on request
2314 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
2315 ctx.load_verify_locations(capath=CAPATH)
2316 self.assertEqual(ctx.get_ca_certs(), [])
2317 with ctx.wrap_socket(socket.socket(socket.AF_INET),
2318 server_hostname='localhost') as s:
2319 s.connect(self.server_addr)
2320 cert = s.getpeercert()
2321 self.assertTrue(cert)
2322 self.assertEqual(len(ctx.get_ca_certs()), 1)
2323
2324 def test_context_setget(self):
2325 # Check that the context of a connected socket can be replaced.

Callers

nothing calls this directly

Calls 6

wrap_socketMethod · 0.95
socketMethod · 0.80
assertTrueMethod · 0.80
assertEqualMethod · 0.45
connectMethod · 0.45
getpeercertMethod · 0.45

Tested by

no test coverage detected