]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: ssl: split the loading of the certificates
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 18 Jul 2019 17:28:17 +0000 (19:28 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 29 Jul 2019 13:28:46 +0000 (15:28 +0200)
commit36b8463777c8b39c3cddecc9b38279b704bac35f
treea50b679510490ee27d03a918be316e5f7b7d6224
parenta59191b8947c94105c9703e7f062093992350815
MEDIUM: ssl: split the loading of the certificates

Split the functions which open the certificates.

Instead of opening directly the certificates and inserting them directly
into a SSL_CTX, we use a struct cert_key_and_chain to store them in
memory and then we associate a SSL_CTX to the certificate stored in that
structure.

Introduce the struct ckch_node for the multi-cert bundles so we can
store multiple cert_key_and_chain in the same structure.

The functions ssl_sock_load_multi_cert() and ssl_sock_load_cert_file()
were modified so they don't open the certicates anymore on the
filesystem. (they still open the sctl and ocsp though).  These functions
were renamed ssl_sock_load_ckchn() and ssl_sock_load_multi_ckchn().

The new function ckchn_load_cert_file() is in charge of loading the
files in the cert_key_and_chain. (TODO: load ocsp and sctl from there
too).

The ultimate goal is to be able to load a certificate from a certificate
tree without doing any filesystem access, so we don't try to open it
again if it was already loaded, and we share its configuration.
src/ssl_sock.c