(self)
| 2093 | s.connect(self.server_addr) |
| 2094 | |
| 2095 | def test_get_ca_certs_capath(self): |
| 2096 | # capath certs are loaded on request |
| 2097 | ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) |
| 2098 | ctx.load_verify_locations(capath=CAPATH) |
| 2099 | self.assertEqual(ctx.get_ca_certs(), []) |
| 2100 | with ctx.wrap_socket(socket.socket(socket.AF_INET), |
| 2101 | server_hostname='localhost') as s: |
| 2102 | s.connect(self.server_addr) |
| 2103 | cert = s.getpeercert() |
| 2104 | self.assertTrue(cert) |
| 2105 | self.assertEqual(len(ctx.get_ca_certs()), 1) |
| 2106 | |
| 2107 | def test_context_setget(self): |
| 2108 | # Check that the context of a connected socket can be replaced. |
nothing calls this directly
no test coverage detected