acoustic-carpenter-78188
04/07/2026, 11:29 PMWantReadError / WantWriteError raised by pyOpenSSL's do_handshake() when socket.create_connection() leaves the fd in non-blocking mode (O_NONBLOCK set for any timeout > 0). Restore blocking mode with sock.settimeout(None) before the TLS handshake.
• Improve resource cleanup: close the raw socket if SSL.Connection() fails before conn is assigned.
• Add tests for empty cert chain, successful close, and socket cleanup on connection setup failure.
• Assert that settimeout(None) is called on the socket, directly covering the core fix.
Test plan
• pytest tests/flyte/remote/test_session.py::TestBootstrapSslFromServer — all 5 tests pass
• Manual verification against a Flyte cluster with insecure_skip_verify=True
flyteorg/flyte-sdkacoustic-carpenter-78188
04/09/2026, 4:13 PMacoustic-carpenter-78188
04/09/2026, 4:13 PM