From a3ac76b1c385bfc053dd7109ab2f49e1e62aa5ab Mon Sep 17 00:00:00 2001 From: yevgeny Date: Mon, 12 Feb 2024 02:45:08 +0900 Subject: [PATCH] gh-110467: update test_wrong_cert_tls13, test_pha_required_nocert assertRaisesRegex (append OSError) --- Lib/test/test_ssl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 98bfa002ba23c1..2571a491d8a1d9 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -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') @@ -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)