bpo-43921: also accept EOF in post-handshake auth test (GH-25574)

This commit is contained in:
Christian Heimes 2021-04-24 15:08:13 +02:00 committed by GitHub
parent a460ab3134
commit ce9a064349
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4424,9 +4424,11 @@ class TestPostHandshakeAuth(unittest.TestCase):
server_hostname=hostname) as s:
s.connect((HOST, server.port))
s.write(b'PHA')
# test sometimes fails with EOF error. Test passes as long as
# server aborts connection with an error.
with self.assertRaisesRegex(
ssl.SSLError,
'tlsv13 alert certificate required'
'(certificate required|EOF occurred)'
):
# receive CertificateRequest
self.assertEqual(s.recv(1024), b'OK\n')