An SSL-encrypting socket wrapper
Go to file
Clemens Lang 8e69cc0314 Speed up loading client CA list
Do not attempt to load and print all trusted CAs unless we need them to
invoke SSL_CTX_set_client_CA_list(3). Loading all trusted CAs can be
slow, especially if there are many. The CAdir format allows OpenSSL to
only load them on demand, avoiding this overhead.

Additionally, SSL_CTX_load_verify_locations(3) supports file formats
that SSL_load_client_CA_file(3) and SSL_add_*_cert_subjects_to_stack(3)
do not support, for example certificates in the BEGIN TRUSTED
CERTIFICATE format. Valid configurations with older stunnel versions
that point to such a file would otherwise needlessly start failing.

Additionally, use SSL_load_client_CA_file(3) to load certificates from
a file rather than SSL_add_file_cert_subjects_to_stack(3), since the
former uses a hashtable for deduplication, but the latter relies on
a sorted STACK_OF(X509_NAME). The sorting is exceptionally slow in
OpenSSL, because the comparison function for X509_NAMEs converts them to
DER involving a memory allocation, which is already expensive, but even
more expensive when used with stunnel's custom allocator functions.

An upstream PR openssl/openssl#25056 will eventually fix this, but it
will take quite a while for this to arrive on users' systems, and it
will likely not be backported into older affected versions of OpenSSL or
their forks.

(cherry picked from commit a154e02ce9)

Resolves: RHEL-46411
Resolves: RHEL-50154
Signed-off-by: Clemens Lang <cllang@redhat.com>
2024-08-07 11:46:24 +02:00
.gitignore New upstream release 5.71 2023-10-05 14:09:33 +02:00
Certificate-Creation Auto sync2gitlab import of stunnel-5.56-5.el8_3.src.rpm 2022-05-26 14:34:55 -04:00
gating.yaml Bring gating.yaml over from Brew dist-git 2023-03-10 11:28:21 -08:00
pgp.asc New upstream release 5.71 2023-10-05 14:09:33 +02:00
pop3-redirect.xinetd Auto sync2gitlab import of stunnel-5.56-5.el8_3.src.rpm 2022-05-26 14:34:55 -04:00
sfinger.xinetd Auto sync2gitlab import of stunnel-5.56-5.el8_3.src.rpm 2022-05-26 14:34:55 -04:00
sources New upstream release 5.71 2023-10-05 14:09:33 +02:00
stunnel-5.50-authpriv.patch New upstream release 5.71 2023-10-05 14:09:33 +02:00
stunnel-5.56-curves-doc-update.patch New upstream release 5.71 2023-10-05 14:09:33 +02:00
stunnel-5.61-systemd-service.patch New upstream release 5.71 2023-10-05 14:09:33 +02:00
stunnel-5.69-default-tls-version.patch New upstream release 5.71 2023-10-05 14:09:33 +02:00
stunnel-5.69-system-ciphers.patch New upstream release 5.71 2023-10-05 14:09:33 +02:00
stunnel-5.71-Preserve-NO_TLSv1.-123-option-compatibility.patch Preserve NO_TLSv1.[123] option compatibility 2023-10-19 14:52:39 +02:00
stunnel-5.72-speed-up-loading-client-CA-list.patch Speed up loading client CA list 2024-08-07 11:46:24 +02:00
stunnel-pop3s-client.conf Auto sync2gitlab import of stunnel-5.56-5.el8_3.src.rpm 2022-05-26 14:34:55 -04:00
stunnel-sfinger.conf Auto sync2gitlab import of stunnel-5.56-5.el8_3.src.rpm 2022-05-26 14:34:55 -04:00
stunnel.spec Speed up loading client CA list 2024-08-07 11:46:24 +02:00
stunnel@.service Auto sync2gitlab import of stunnel-5.56-5.el8_3.src.rpm 2022-05-26 14:34:55 -04:00