MINOR: ssl: Use ocsp update task for "update ssl ocsp-response" command
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Mon, 13 Mar 2023 14:56:32 +0000 (15:56 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 14 Mar 2023 10:07:32 +0000 (11:07 +0100)
commita6c0a59e9af65180c3ff591b91855bea8d19b352
treec9200e6204305db9fbf85003ac3b91e1925db10c
parentc9bfe32b712e6a3bf07c7d14811007eb738a46e5
MINOR: ssl: Use ocsp update task for "update ssl ocsp-response" command

Instead of having a dedicated httpclient instance and its own code
decorrelated from the actual auto update one, the "update ssl
ocsp-response" will now use the update task in order to perform updates.

Since the cli command allows to update responses that were never
included in the auto update tree, a new flag was added to the
certificate_ocsp structure so that the said entry can be inserted into
the tree "by hand" and it won't be reinserted back into the tree after
the update process is performed. The 'update_once' flag "stole" a bit
from the 'fail_count' counter since it is the one less likely to reach
UINT_MAX among the ocsp counters of the certificate_ocsp structure.

This new logic required that every certificate_ocsp entry contained all
the ocsp-related information at all time since entries that are not
supposed to be configured automatically can still be updated through the
cli. The logic of the ssl_sock_load_ocsp was changed accordingly.
include/haproxy/ssl_ocsp-t.h
reg-tests/ssl/ocsp_auto_update.vtc
src/ssl_ocsp.c
src/ssl_sock.c