[3.6] bpo-31320: No traceback to sys.stderr in test_ssl (GH-3360) (GH… · python/cpython@c506403
@@ -1843,11 +1843,14 @@ def wrap_conn(self):
18431843self.sock, server_side=True)
18441844self.server.selected_npn_protocols.append(self.sslconn.selected_npn_protocol())
18451845self.server.selected_alpn_protocols.append(self.sslconn.selected_alpn_protocol())
1846-except (ssl.SSLError, ConnectionResetError) as e:
1846+except (ssl.SSLError, ConnectionResetError, OSError) as e:
18471847# We treat ConnectionResetError as though it were an
18481848# SSLError - OpenSSL on Ubuntu abruptly closes the
18491849# connection when asked to use an unsupported protocol.
18501850#
1851+# OSError may occur with wrong protocols, e.g. both
1852+# sides use PROTOCOL_TLS_SERVER.
1853+#
18511854# XXX Various errors can have happened here, for example
18521855# a mismatching protocol version, an invalid certificate,
18531856# or a low-level bug. This should be made more discriminating.