MINOR: ssl: diagnostic warning when both 'default-crt' and 'strict-sni' are used
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 27 Aug 2025 13:44:24 +0000 (15:44 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 7 Oct 2025 08:37:11 +0000 (10:37 +0200)
commit47f8dcc7c57e032f2d5dbd8adb9158e0700f4b03
tree6f4be62d8f73fb96dd39f0475908af5faabe205a
parent21a355d3bbe6003772ea069fe7af88400b0d9a9a
MINOR: ssl: diagnostic warning when both 'default-crt' and 'strict-sni' are used

It possible to use both 'strict-sni' and 'default-crt' on the same bind
line, which does not make much sense.

This patch implements a check which will look for default certificates
in the sni_w tree when strict-sni is used. (Referenced by their empty
sni ""). default-crt sets the CKCH_INST_EXPL_DEFAULT flag in
ckch_inst->is_default, so its possible to differenciate explicits
default from implicit default.

Could be backported as far as 3.0.

This was discussed in ticket #3082.

(cherry picked from commit 18ebd81962e1f53b8f59bfee5b9795bff69ac16b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit a9010888c016718d1b5200e88b0410ad315f8f64)
[wla: BC_SSL_O_STRICT_SNI doesn't exist and must be replaced by
strict_sni]
Signed-off-by: William Lallemand <wlallemand@haproxy.com>
(cherry picked from commit 39f930548d188c92aacf3107dcb8e03bca069a4b)
Signed-off-by: William Lallemand <wlallemand@haproxy.com>
include/haproxy/ssl_ckch-t.h
src/cfgparse-ssl.c
src/ssl_ckch.c
src/ssl_sock.c