BUG/MEDIUM: server: Use sni as pool connection name for SSL server only
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Sep 2025 13:29:56 +0000 (15:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Oct 2025 14:48:35 +0000 (16:48 +0200)
commit6b5f06f49ef051a50e2a2fb048f3df8cad002731
tree6644312fd9a488c6c7a7846e56ab488ed82f0667
parent262a7bfccc0c9731af7a5d652b457eb4dbf20fa7
BUG/MEDIUM: server: Use sni as pool connection name for SSL server only

By default, for a given server, when no pool-conn-name is specified, the
configured sni is used. However, this must only be done when SSL is in-use
for the server. Of course, it is uncommon to have a sni expression for
now-ssl server. But this may happen.

In addition, the SSL may be disabled via the CLI. In that case, the
pool-conn-name must be discarded if it was copied from the sni. And, we must
of course take care to set it if the ssl is enabled.

Finally, when the attac-srv action is checked, we now checked the
pool-conn-name expression.

This patch should be backported as far as 3.0. It relies on "MINOR: server:
Parse sni and pool-conn-name expressions in a dedicated function" which
should be backported too.

(cherry picked from commit f8f94ffc9c26bb8c2ff261972ce2f6c4fd731f6d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 0d57285653b93428368112a9fbfbe59a40848707)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 5ff4c9da3720c4e1fd194c72670bfb4b108b7ce1)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/server.h
src/server.c
src/server_state.c
src/tcp_act.c