BUG/MEDIUM: checks: fix ALPN inheritance from server
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 9 Sep 2025 13:34:25 +0000 (15:34 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Oct 2025 14:48:35 +0000 (16:48 +0200)
commit53a26cfc46a1ee0c5eff0c2d172e17f0fcb39791
tree1e7246e2e871d43b5a479ce18a32e10a3af2b1c6
parentf7ade295c8cf4f2f385f20700ba4a4f3fdd1779b
BUG/MEDIUM: checks: fix ALPN inheritance from server

If no specific check settings are defined on a server line, it is
expected that these checks will be performed with the same parameters as
normal connections on the same server.

ALPN must be carefully taken into account for checks. Most notably, MUX
initialization is delayed so that it is performed only after SSL
handshake.

Prior to this patch, MUX init delay was only performed if ALPN was
defined via check settings. Thus, with the following settings, checks
would be performed on HTTP/1.1 without consulting ALPN negotiation
result from the server :

  server s1 127.0.0.1:443 ssl crt <...> alpn h2 check

This bug may result in checks reporting failure, for example in case of
a server answering HTTP/2 to ALPN negotiation to the configuration
above. Besides, there is incoherency between normal and check
connections, which is not what the documentation specifies.

This patch fixes this code. Now server parameters are also taken into
account. This ensures that checks and normal connections by default
use the same connection method.

This must be backported up to 2.4.

(cherry picked from commit c6d33c09fc2c60fe0ffb54464a550e1b7bd69c4c)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 1d606e7e8c9789b8a0f9212eae6573cafb21ff82)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 5cf8f3e7d070eb258cf15b77a307acc02927746b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/tcpcheck.c