(self)
| 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. |
nothing calls this directly
no test coverage detected