From: Olivier Houchard Date: Fri, 27 Nov 2026 13:12:13 +0000 (+0100) Subject: BUG/MINOR: connection: don't use the cached ALPN if SSL_NO_CACHED_INFO X-Git-Url: https://git.kaiwu.me/http/%22../$%7BGITURL%7D/static/gitweb.js?a=commitdiff_plain;h=82863c6b19b59c5b6ee1a432bc542948f4e4d4f7;p=haproxy.git BUG/MINOR: connection: don't use the cached ALPN if SSL_NO_CACHED_INFO conn_select_mux_be() and conn_install_mux_be() fall back to the ALPN cached in the server when the connection has none, even when the connection has CO_FL_SSL_NO_CACHED_INFO. A websocket connection that only offers http/1.1 to a server which then selects no ALPN gets an H2 mux if the regular connections negotiated h2, and the request ends in a 502. Let's not use the cache for those connections. This should help with github issue #3473, and must be backported to 3.3. --- diff --git a/src/connection.c b/src/connection.c index 2090087a5..e2ac22edd 100644 --- a/src/connection.c +++ b/src/connection.c @@ -425,7 +425,8 @@ const struct mux_proto_list *conn_select_mux_be(const struct connection *conn) return srv->mux_proto; if (!conn_get_alpn(conn, &alpn_str, &alpn_len)) { - if (srv && srv->path_params.nego_alpn[0]) { + if (srv && !(conn->flags & CO_FL_SSL_NO_CACHED_INFO) && + srv->path_params.nego_alpn[0]) { alpn_str = srv->path_params.nego_alpn; alpn_len = strlen(alpn_str); } @@ -466,7 +467,8 @@ int conn_install_mux_be(struct connection *conn, void *ctx, struct session *sess int mode = conn_pr_mode_to_proto_mode(srv->proxy->mode); if (!conn_get_alpn(conn, &alpn_str, &alpn_len)) { - if (srv && srv->path_params.srv_hash == conn->hash_node.key && srv->path_params.nego_alpn[0]) { + if (srv && !(conn->flags & CO_FL_SSL_NO_CACHED_INFO) && + srv->path_params.srv_hash == conn->hash_node.key && srv->path_params.nego_alpn[0]) { alpn_str = srv->path_params.nego_alpn; alpn_len = strlen(alpn_str); }