From: Amaury Denoyelle Date: Tue, 28 Jul 2026 16:52:26 +0000 (+0200) Subject: BUG/MINOR: server: fix QUIC on server-template X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=6b96eb7b023d0c31d073402d5e3fb23e4238db97;p=thirdparty%2Fhaproxy.git BUG/MINOR: server: fix QUIC on server-template For QUIC backend side support, server xprt has to be set to XPRT_QUIC when a quic4/6 address is parsed. Prior to this patch, this was performed in _srv_parse_init(). However this is not functional with server-template as this function is not called for the duplicated entries. Xprt field was not updated, which prevented any communication on these servers. To properly initialize a QUIC server, uses the same method as SSL. Server xprt is now set later during ssl_sock_prepare_srv_ctx(). This callback is invoked through XPRT prepare_srv during proxy_finalize(), called for any servers with SSL or QUIC settings. This must be backported up to 3.3. --- diff --git a/src/server.c b/src/server.c index f4d3eb04e..1f328a887 100644 --- a/src/server.c +++ b/src/server.c @@ -3778,10 +3778,6 @@ static int _srv_parse_init(struct server **srv, char **args, int *cur_arg, err_code |= ERR_ALERT | ERR_FATAL; goto out; } - - mark_tainted(TAINTED_CONFIG_EXP_KW_DECLARED); - newsrv->xprt = xprt_get(XPRT_QUIC); - quic_transport_params_init(&newsrv->quic_params, 0); } #else if (srv_is_quic(newsrv)) { diff --git a/src/ssl_sock.c b/src/ssl_sock.c index c1bf57400..0013905a7 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -5143,9 +5143,17 @@ int ssl_sock_prepare_srv_ctx(struct server *srv) } } - /* The QUIC server xprt has already been set. */ - if (srv->use_ssl == 1 && !srv_is_quic(srv)) - srv->xprt = &ssl_sock; + if (srv->use_ssl == 1) { +#ifdef USE_QUIC + if (srv_is_quic(srv)) { + mark_tainted(TAINTED_CONFIG_EXP_KW_DECLARED); + srv->xprt = xprt_get(XPRT_QUIC); + quic_transport_params_init(&srv->quic_params, 0); + } + else +#endif + srv->xprt = &ssl_sock; + } if (srv->ssl_ctx.client_crt) { const int create_if_none = srv->flags & SRV_F_DYNAMIC ? 0 : 1;