client_context.set_client_sigalgs("rsa_pss_rsae_sha256")
server_context.set_client_sigalgs("rsa_pss_rsae_sha384")
- # Some systems return ConnectionResetError on handshake failures
- with self.assertRaises((ssl.SSLError, ConnectionResetError)):
+ with self.assertRaises((
+ ssl.SSLError,
+ # On handshake failures, some systems raise a ConnectionResetError.
+ ConnectionResetError,
+ # On handshake failures, macOS may raise a BrokenPipeError.
+ # See https://github.com/python/cpython/issues/139504.
+ BrokenPipeError,
+ )):
server_params_test(client_context, server_context,
chatty=True, connectionchatty=True,
sni_name=hostname)