]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
OPTIM: check: do not delay MUX for ALPN if SSL not active
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 9 Sep 2025 12:27:24 +0000 (14:27 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 9 Sep 2025 14:55:09 +0000 (16:55 +0200)
To ensure ALPN is properly applied on checks, MUX initialization is
delayed so that it is created on SSL handshake completion. However, this
does not check if SSL is really active for the connection.

This patch adjusts the condition so that MUX init is not delayed if SSL
is not active for the check connection. A similar process is already
conducted for normal connections via connect_server().

This must be backported up to 2.4. Despite not being a bug, it must be
backported for the following patch which fixes check ALPN inheritance
from server settings.

src/tcpcheck.c

index 144ea256cede13eabb6f61d48d7bfe40e766e3cf..b4b032ef0424a6add0239e0d3aeef519a918e110 100644 (file)
@@ -1511,7 +1511,8 @@ enum tcpcheck_eval_ret tcpcheck_eval_connect(struct check *check, struct tcpchec
         * is no alpn.
         */
        if (!s || ((connect->options & TCPCHK_OPT_DEFAULT_CONNECT) && check->mux_proto) ||
-           connect->mux_proto || (!connect->alpn && !check->alpn_str)) {
+           connect->mux_proto ||
+           (!conn_is_ssl(conn) || (!connect->alpn && !check->alpn_str))) {
                const struct mux_ops *mux_ops;
 
                TRACE_DEVEL("try to install mux now", CHK_EV_TCPCHK_CONN, check);