Skip to content

Commit ea4027e

Browse files
vstinnerpicnixz
andauthored
gh-139504: Catch BrokenPipeError in ssl test_client_sigalgs_mismatch() (#139505)
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 16da633 commit ea4027e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Lib/test/test_ssl.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4346,8 +4346,14 @@ def test_client_sigalgs_mismatch(self):
43464346
client_context.set_client_sigalgs("rsa_pss_rsae_sha256")
43474347
server_context.set_client_sigalgs("rsa_pss_rsae_sha384")
43484348

4349-
# Some systems return ConnectionResetError on handshake failures
4350-
with self.assertRaises((ssl.SSLError, ConnectionResetError)):
4349+
with self.assertRaises((
4350+
ssl.SSLError,
4351+
# On handshake failures, some systems raise a ConnectionResetError.
4352+
ConnectionResetError,
4353+
# On handshake failures, macOS may raise a BrokenPipeError.
4354+
# See https://github.com/python/cpython/issues/139504.
4355+
BrokenPipeError,
4356+
)):
43514357
server_params_test(client_context, server_context,
43524358
chatty=True, connectionchatty=True,
43534359
sni_name=hostname)

0 commit comments

Comments
 (0)