BUG/MINOR: ssl/cli: can't find ".crt" files when replacing a certificate
authorWilliam Lallemand <wlallemand@haproxy.org>
Mon, 28 Aug 2023 15:12:14 +0000 (17:12 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 28 Aug 2023 16:20:39 +0000 (18:20 +0200)
commite7d9082315e33e41347b2a7dbaaaa949e995f5b7
tree62e26376b1617ad5e9069bd674d2bc6bdb7f1eb3
parent0074c36dd22e4bb09d1ed24de416ab8bb9ce25da
BUG/MINOR: ssl/cli: can't find ".crt" files when replacing a certificate

Bug was introduced by commit 26654 ("MINOR: ssl: add "crt" in the
cert_exts array").

When looking for a .crt directly in the cert_exts array, the
ssl_sock_load_pem_into_ckch() function will be called with a argument
which does not have its ".crt" extensions anymore.

If "ssl-load-extra-del-ext" is used this is not a problem since we try
to add the ".crt" when doing the lookup in the tree.

However when using directly a ".crt" without this option it will failed
looking for the file in the tree.

The fix removes the "crt" entry from the array since it does not seem to
be really useful without a rework of all the lookups.

Should fix issue #2265

Must be backported as far as 2.6.
include/haproxy/ssl_ckch-t.h
reg-tests/ssl/bug-2265.crt [new symlink]
reg-tests/ssl/set_ssl_bug_2265.vtc [new file with mode: 0644]
src/ssl_ckch.c