haypo@selma$ ./python -m test test_ssl -m test.test_ssl.ThreadedTests.test_echo
Run tests sequentially
0:00:00 load avg: 0.69 [1/1] test_ssl
Exception in thread Thread-16:
Traceback (most recent call last):
File "/home/haypo/prog/python/master/Lib/threading.py", line 917, in _bootstrap_innerself.run()
File "/home/haypo/prog/python/master/Lib/test/test_ssl.py", line 1936, in runifnotself.wrap_conn():
File "/home/haypo/prog/python/master/Lib/test/test_ssl.py", line 1881, in wrap_connself.sock, server_side=True)
File "/home/haypo/prog/python/master/Lib/ssl.py", line 401, in wrap_socket
File "/home/haypo/prog/python/master/Lib/ssl.py", line 808, in __init__self.do_handshake()
File "/home/haypo/prog/python/master/Lib/ssl.py", line 1061, in do_handshakeself._sslobj.do_handshake()
File "/home/haypo/prog/python/master/Lib/ssl.py", line 683, in do_handshakeself._sslobj.do_handshake()
OSError: [Errno 0] Error
Not sure if you just want to hide the presence of the exception and traceback. But regarding the exception itself (OSError with errno 0), this is not ideal. From memory, you tend to get this when the connection is shut down insecurely at the TCP level. A better exception would be SSLEOFError. Similar report in bpo-31122 (same wrap_socket → do_handshake chain). Probably also relevant: bpo-10808.
The error occurs in the test case that uses a PROTOCOL_TLS_SERVER context for both client and server context. In that case, OpenSSL wrap_socket() fails internally and OpenSSL raises an OSError with errno 0.
Simple fix: catch OSError in the client thread and fail the test appropriately.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
The text was updated successfully, but these errors were encountered: