From 73ce20faa03e8c2670abc78bf7da73bb8bbe2bf5 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 16 Oct 2026 17:05:11 +0200 Subject: [PATCH] BUG/MEDIUM: server: Don't use the cached ALPN for websocket When using websockets, we may end up using a different ALPN than the one we usually use with the server, so do not reuse the cached ALPN, if any, and do not cache the one we used for that connection. Otherwise, we may end up with websocket connections that will attempt to use the wrong mux, and end in error. Not making any attempt at caching the ALPN means we can't easily use 0RTT with websockets, but I do not believe this is a big problem. This will hopefully help with github issue #3473. This should be backported up to 3.3. --- src/backend.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend.c b/src/backend.c index 1c374676e..2f0fe7ea2 100644 --- a/src/backend.c +++ b/src/backend.c @@ -2161,8 +2161,15 @@ int connect_server(struct stream *s) break; } - if (!conn_update_alpn(srv_conn, ist(alpn), force)) + if (!conn_update_alpn(srv_conn, ist(alpn), force)) { + /* + * Possibly the ALPN will be different, + * so don't use any cached value. + */ + may_start_mux_now = 0; + srv_conn->flags |= CO_FL_SSL_NO_CACHED_INFO; DBG_TRACE_STATE("update alpn for websocket", STRM_EV_STRM_PROC|STRM_EV_CS_ST, s); + } } #endif } -- 2.47.3