]> git.kaiwu.me - haproxy.git/commit
MINOR: ssl: unset SSLKEYLOGFILE unless explicitly allowed
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Dec 2026 12:56:42 +0000 (12:56 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 1 Dec 2026 15:20:59 +0000 (16:20 +0100)
commitbe97b95b58a1c0286737828641ad3862a848084e
treefb43eeb452461c07949363395a9c77d48a145a3b
parent0e166c943812e603fe33f6daa96b7b100645468c
MINOR: ssl: unset SSLKEYLOGFILE unless explicitly allowed

OpenSSL 3.5 builds configured with enable-sslkeylog honor SSLKEYLOGFILE
and write TLS connection secrets directly to a file. This bypasses HAProxy
logging, adds filesystem access during handshakes, degrades performance
and leaks file descriptors across master-worker reloads. HAProxy already
provides tune.ssl.keylog and sample fetches for logging these secrets
through its normal logging facilities.

Replace the startup warnings with a conditional unsetenv() before full
configuration parsing can load certificates and create SSL contexts.
Add the experimental ssl-workaround-bogus-keylogfile { on | off } global
option, defaulting to off. Setting it to on leaves the variable untouched;
setting it to off keeps the default behavior of removing the variable.

Discover this option and expose-experimental-directives during the initial
configuration pass so the decision is known before certificate loading.
Repeat the conditional unsetenv() after a worker restores its initial
environment. Keep the original environment backup unchanged so reloads
can reevaluate the option, without copying or restoring the variable.

Document the OpenSSL version and build option requirements, discourage
native key logging due to its filesystem access and reload issues, and
recommend tune.ssl.keylog instead.
doc/configuration.txt
include/haproxy/ssl_sock-t.h
src/cfgparse-global.c
src/cfgparse-ssl.c
src/haproxy.c