Skip to content

Commit 567fbcb

Browse files
keepworkingencukou
andcommitted
Apply suggestions from code review
- merge ssl.SSLError and OSError as OSError - append assertRaisesRegex for test_wrong_cert_tls13 ('Connection reset by peer') Co-authored-by: Petr Viktorin <[email protected]>
1 parent d97a8d1 commit 567fbcb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_ssl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3168,8 +3168,8 @@ def test_wrong_cert_tls13(self):
31683168
suppress_ragged_eofs=False) as s:
31693169
s.connect((HOST, server.port))
31703170
with self.assertRaisesRegex(
3171-
ssl.SSLError,
3172-
'alert unknown ca|EOF occurred|TLSV1_ALERT_UNKNOWN_CA'
3171+
OSError,
3172+
'alert unknown ca|EOF occurred|TLSV1_ALERT_UNKNOWN_CA|closed by the remote host|Connection reset by peer'
31733173
):
31743174
# TLS 1.3 perform client cert exchange after handshake
31753175
s.write(b'data')
@@ -4534,7 +4534,7 @@ def msg_cb(conn, direction, version, content_type, msg_type, data):
45344534
# test sometimes fails with EOF error. Test passes as long as
45354535
# server aborts connection with an error.
45364536
with self.assertRaisesRegex(
4537-
(ssl.SSLError, OSError),
4537+
OSError,
45384538
'(certificate required|EOF occurred|closed by the remote host)'
45394539
):
45404540
# receive CertificateRequest

0 commit comments

Comments
 (0)