(self)
| 5140 | self.assertEqual(s.recv(1024), b'FALSE\n') |
| 5141 | |
| 5142 | def test_pha_no_pha_client(self): |
| 5143 | client_context, server_context, hostname = testing_context() |
| 5144 | server_context.post_handshake_auth = True |
| 5145 | server_context.verify_mode = ssl.CERT_REQUIRED |
| 5146 | client_context.load_cert_chain(SIGNED_CERTFILE) |
| 5147 | |
| 5148 | server = ThreadedEchoServer(context=server_context, chatty=False) |
| 5149 | with server: |
| 5150 | with client_context.wrap_socket(socket.socket(), |
| 5151 | server_hostname=hostname) as s: |
| 5152 | s.connect((HOST, server.port)) |
| 5153 | with self.assertRaisesRegex(ssl.SSLError, 'not server'): |
| 5154 | s.verify_client_post_handshake() |
| 5155 | s.write(b'PHA') |
| 5156 | self.assertIn(b'extension not received', s.recv(1024)) |
| 5157 | |
| 5158 | def test_pha_no_pha_server(self): |
| 5159 | # server doesn't have PHA enabled, cert is requested in handshake |
nothing calls this directly
no test coverage detected