]> git.kaiwu.me - haproxy.git/commit
MEDIUM: ssl: add ocsp-update.timeout global option
authorAlex Szakaly <alex.szakaly@gmail.com>
Fri, 18 Sep 2026 20:22:54 +0000 (22:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 21 Sep 2026 13:45:25 +0000 (15:45 +0200)
commit7baa3f3fca62433d46a8482bac2fcf8fc3f01ddc
tree5c9c2c9016684e7dec11411ecb6d46228a3c6c0b
parenta39562d6e9c3b1d20c57392eb4b66be9bc089652
MEDIUM: ssl: add ocsp-update.timeout global option

The httpclient used to fetch OCSP responses during automatic updates
only has a connect timeout (5s), no server timeout: if a response
starts but is never fully delivered, the request can hang forever.
This task and its httpclient are shared by the whole ocsp-update
queue, so a single stuck request blocks every other certificate
waiting behind it, effectively stalling all further OCSP updates.

Add a global "ocsp-update.timeout <timeout>" option and apply it with
httpclient_set_timeout() before each update request is sent. This
bounds the total time spent on one OCSP fetch, from the connection
attempt to the full response, and lets a stuck or overly slow
responder be retried later following the usual
ocsp-update.mindelay/maxdelay rules instead of blocking the queue
indefinitely.

The value is parsed with parse_time_err() using TIME_UNIT_MS, the same
helper and default unit used by every other timeout keyword in the
codebase (e.g. "timeout connect", "tcp-ut"), so it accepts a bare
number in milliseconds or any value suffixed with an explicit unit.
It defaults to 10s (SSL_OCSP_UPDATE_HTTP_TIMEOUT, now expressed in
milliseconds).

Can be backported to stable branches that already carry the other
ocsp-update.* global options.

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
doc/configuration.txt
include/haproxy/ssl_ocsp-t.h
include/haproxy/ssl_sock-t.h
src/ssl_ocsp.c
src/ssl_sock.c