bpo-43921: Debug test_ssl failures on Windows by vstinner · Pull Request #26501 · python/cpython

Seen on Windows: the first read() returned an empty string, but the test still pass since the second write() raised an SSL exception.

test_wrong_cert_tls13 (test.test_ssl.ThreadedTests) ...  server:  new connection from ('127.0.0.1', 54508)
write1 4
recv1 0

SSLError is SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2370)')

 server:  bad connection attempt from ('127.0.0.1', 54508):
Traceback (most recent call last):
   File "C:\vstinner\python\main\lib\test\test_ssl.py", line 2364, in wrap_conn
    self.sslconn = self.server.context.wrap_socket(
   File "C:\vstinner\python\main\lib\ssl.py", line 518, in wrap_socket
    return self.sslsocket_class._create(
   File "C:\vstinner\python\main\lib\ssl.py", line 1070, in _create
    self.do_handshake()
   File "C:\vstinner\python\main\lib\ssl.py", line 1339, in do_handshake
    self._sslobj.do_handshake()
 ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:983)
ok