8000 gh-115627: Fix PySSL_SetError handling SSL_ERROR_SYSCALL by keepworking · Pull Request #115628 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-115627: Fix PySSL_SetError handling SSL_ERROR_SYSCALL #115628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 26, 2024
Merged
Prev Previous commit
Next Next commit
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 <encukou@gmail.com>
  • Loading branch information
keepworking and encukou committed Mar 22, 2024
commit 567fbcb846e3098c0565e86deac84920585c4209
6 changes: 3 additions & 3 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3168,8 +3168,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|TLSV1_ALERT_UNKNOWN_CA'
OSError,
'alert unknown ca|EOF occurred|TLSV1_ALERT_UNKNOWN_CA|closed by the remote host|Connection reset by peer'
):
# TLS 1.3 perform client cert exchange after handshake
s.write(b'data')
Expand Down Expand Up @@ -4534,7 +4534,7 @@ 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, OSError),
OSError,
'(certificate required|EOF occurred|closed by the remote host)'
):
# receive CertificateRequest
Expand Down
0