Skip to content

Commit

Permalink
pythongh-110467: update test_wrong_cert_tls13, test_pha_required_noce…
Browse files Browse the repository at this point in the history
…rt assertRaisesRegex (append OSError)
  • Loading branch information
keepworking committed Feb 11, 2024
1 parent bd0cf4f commit a3ac76b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3096,8 +3096,8 @@ def test_wrong_cert_tls13(self):
suppress_ragged_eofs=False) as s:
s.connect((HOST, server.port))
with self.assertRaisesRegex(
ssl.SSLError,
'alert unknown ca|EOF occurred'
(ssl.SSLError, OSError),
'(alert unknown ca|EOF occurred|ConnectionResetError)'
):
# TLS 1.3 perform client cert exchange after handshake
s.write(b'data')
Expand Down Expand Up @@ -4449,8 +4449,8 @@ def msg_cb(conn, direction, version, content_type, msg_type, data):
# test sometimes fails with EOF error. Test passes as long as
# server aborts connection with an error.
with self.assertRaisesRegex(
ssl.SSLError,
'(certificate required|EOF occurred)'
(ssl.SSLError, OSError),
'(certificate required|EOF occurred|ConnectionResetError)'
):
# receive CertificateRequest
data = s.recv(1024)
Expand Down

0 comments on commit a3ac76b

Please sign in to comment.