MEDIUM: ssl: Add "set+commit ssl ca-file" CLI commands
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Wed, 24 Feb 2021 16:35:43 +0000 (17:35 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 17 May 2021 08:50:24 +0000 (10:50 +0200)
commita32a68bd3b9ab1f48bc0b2ec61556c698972caf6
treef1de34ed19bab242fff9d432b60f0ecc7879976d
parentbfadc02f34b348e654d0b14b7f6bab1e3363ce55
MEDIUM: ssl: Add "set+commit ssl ca-file" CLI commands

This patch adds the "set ssl ca-file" and "commit ssl ca-file" commands,
following the same logic as the certificate update equivalents.
When trying to update a ca-file entry via a "set" command, we start by
looking for the entry in the cafile_tree and then building a new
cafile_entry out of the given payload. This new object is not added to
the cafile_tree until "commit" is called.
During a "commit" command, we insert the newly built cafile_entry in the
cafile_tree, while keeping the previous entry as well. We then iterate
over all the instances linked in the old cafile_entry and rebuild a new
ckch instance for every one of them. The newly inserted cafile_entry is
used for all those new instances and their respective SSL contexts.
When all the contexts are properly created, the old instances get
replaced by the new ones and the old cafile_entry is removed from the
tree.

This fixes a subpart of GitHub issue #1057.
include/haproxy/applet-t.h
src/ssl_ckch.c