From 6ebd4fcf5bbd015dcda44fc6f9bbf1dadd547bbe Mon Sep 17 00:00:00 2001 From: sjorsdonkers <72333389+sjorsdonkers@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:28:53 +0200 Subject: [PATCH] fix unencrypted keepalive --- src/http/client.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/http/client.zig b/src/http/client.zig index 3a9c131c..d719006f 100644 --- a/src/http/client.zig +++ b/src/http/client.zig @@ -806,12 +806,12 @@ pub const Request = struct { log.warn(.http, "not implemented", .{ .feature = "async tls connect" }); } - if (self._connection_from_keepalive and - ((self._client.isProxy() and self._proxy_secure) or (!self._client.isForwardProxy() and self._request_secure))) - { - // If the connection came from the keepalive pool, than we already have a TLS Connection. - async_handler.conn.protocol = .{ .encrypted = .{ .conn = &connection.tls.?.nonblocking } }; - // and we're already connected + if (self._connection_from_keepalive) { + if ((self._client.isProxy() and self._proxy_secure) or (!self._client.isForwardProxy() and self._request_secure)) { + // If the connection came from the keepalive pool, than we already have a TLS Connection. + async_handler.conn.protocol = .{ .encrypted = .{ .conn = &connection.tls.?.nonblocking } }; + } + // We're already connected async_handler.pending_connect = false; return async_handler.conn.connected(); }