crtlist_dup_ssl_conf() duplicates a ssl_bind_conf for the crt-list
entries created by the multi-keytype bundle emulation (crt.pem.ecdsa +
.pem.rsa) and for each "ssl-f-use" rule, but it never copied the
verify, no_ca_names, early_data and ktls scalar fields. Because dst
is allocated with calloc(), the duplicates always carried
verify == SSL_SOCK_VERIFY_NONE, so the switch in
ssl_sock_prepare_ctx() fell back to the bind-level ssl_conf and
configured OpenSSL with SSL_VERIFY_NONE: a "verify required ca-file"
set on a crt-list line or on a ssl-f-use line was silently ignored
for every keytype of a bundle (and for the whole frontend with
ssl-f-use), letting unauthenticated clients complete the TLS
handshake and reach the backend with ssl_c_used == 0, without any
warning at startup or under "haproxy -c".
The bundle duplication exists since 2.3 and the ssl-f-use rules since
3.2. Copying the scalar fields is enough to restore the intended
behaviour: entry-level verify is now enforced on every duplicated
entry.
Note for backports: the ktls field of struct ssl_bind_conf was
introduced in 3.3 (
e8674658aec "MINOR: cfgparse: Add a new ktls option
to bind and server"), so the "dst->ktls = src->ktls;" line must be
dropped when backporting to 3.2, 3.1 and 3.0. The other three fields
(verify, no_ca_names, early_data) exist in every concerned branch.
Reported-by: Dominik Maier <dmnk@google.com>