MCPcopy Index your code
hub / github.com/python/cpython / test_pha_no_pha_client

Method test_pha_no_pha_client

Lib/test/test_ssl.py:5142–5156  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 10

testing_contextFunction · 0.85
ThreadedEchoServerClass · 0.85
wrap_socketMethod · 0.80
socketMethod · 0.80
assertRaisesRegexMethod · 0.80
assertInMethod · 0.80
connectMethod · 0.45
writeMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected