(self)
| 1696 | self.assertIn("NO_START_LINE", s) |
| 1697 | |
| 1698 | def test_subclass(self): |
| 1699 | # Check that the appropriate SSLError subclass is raised |
| 1700 | # (this only tests one of them) |
| 1701 | ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) |
| 1702 | ctx.check_hostname = False |
| 1703 | ctx.verify_mode = ssl.CERT_NONE |
| 1704 | with socket.create_server(("127.0.0.1", 0)) as s: |
| 1705 | c = socket.create_connection(s.getsockname()) |
| 1706 | c.setblocking(False) |
| 1707 | with ctx.wrap_socket(c, False, do_handshake_on_connect=False) as c: |
| 1708 | with self.assertRaises(ssl.SSLWantReadError) as cm: |
| 1709 | c.do_handshake() |
| 1710 | s = str(cm.exception) |
| 1711 | self.assertStartsWith(s, "The operation did not complete (read)") |
| 1712 | # For compatibility |
| 1713 | self.assertEqual(cm.exception.errno, ssl.SSL_ERROR_WANT_READ) |
| 1714 | |
| 1715 | |
| 1716 | def test_bad_server_hostname(self): |
nothing calls this directly
no test coverage detected