Commit Graph

5 Commits

Author SHA1 Message Date
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
Clemens Lang
0334b7c96b Preserve NO_TLSv1.[123] option compatibility
On RHEL 8, stunnel used to support the NO_TLSv1.1, NO_TLSv1.2, and
NO_TLSv1.3 values for the options directive. Since we do not break
compatibility, preserve these options for customers that have them set.

Resolves: RHEL-2340
Signed-off-by: Clemens Lang <cllang@redhat.com>
2023-10-19 14:52:39 +02:00
Clemens Lang
49fc206f2d New upstream release 5.71
Drop patches that are no longer needed, sync patches from Fedora.
Backport spec file improvements from Fedora.

Resolves: RHEL-2340
Signed-off-by: Clemens Lang <cllang@redhat.com>
2023-10-05 14:09:33 +02:00
Adam Samalik
c322d2e347 re-import sources as agreed with the maintainer 2023-07-10 12:42:38 +02:00
James Antill
262b45e208 Auto sync2gitlab import of stunnel-5.56-5.el8_3.src.rpm 2022-05-26 14:34:55 -04:00