(self)
| 1913 | self.assertIn("NO_START_LINE", s) |
| 1914 | |
| 1915 | def test_subclass(self): |
| 1916 | # Check that the appropriate SSLError subclass is raised |
| 1917 | # (this only tests one of them) |
| 1918 | ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) |
| 1919 | ctx.check_hostname = False |
| 1920 | ctx.verify_mode = ssl.CERT_NONE |
| 1921 | with socket.create_server(("127.0.0.1", 0)) as s: |
| 1922 | c = socket.create_connection(s.getsockname()) |
| 1923 | c.setblocking(False) |
| 1924 | with ctx.wrap_socket(c, False, do_handshake_on_connect=False) as c: |
| 1925 | with self.assertRaises(ssl.SSLWantReadError) as cm: |
| 1926 | c.do_handshake() |
| 1927 | s = str(cm.exception) |
| 1928 | self.assertStartsWith(s, "The operation did not complete (read)") |
| 1929 | # For compatibility |
| 1930 | self.assertEqual(cm.exception.errno, ssl.SSL_ERROR_WANT_READ) |
| 1931 | |
| 1932 | |
| 1933 | def test_bad_server_hostname(self): |
nothing calls this directly
no test coverage detected