Close the tunnel when the TLS handshake through a proxy fails

SSLClient::setup_proxy_connection() left the socket open when the TLS
handshake inside the CONNECT tunnel failed, so the client kept a
connection with no TLS session on it. Only the next request's reuse
check closed it, because tls::is_peer_closed() reports a missing
session as closed. Close it where the handshake fails, as
ensure_socket_connection() does for a direct connection.
This commit is contained in:
yhirose authored and yhirose committed 2026-11-16 23:41:25 -05:00
1 parent f57672b390
commit 1b40ce850b
2 files changed
+36

No files matched your search

+2
View File
@@ -19327,6 +19327,8 @@ inline bool SSLClient::setup_proxy_connection(
}
if (!initialize_ssl(socket, error)) {
shutdown_socket(socket);
close_socket(socket);
success = false;
return false;
}