Optional kernel TLS with OpenSSL (ssl_ktls)

ssl_ktls asks OpenSSL to hand TLS to the kernel (SSL_OP_ENABLE_KTLS)
on the connections of the services which follow, both to clients and
to servers; ssl_noktls, the default, keeps it in 3proxy. Where the
library, the kernel and the cipher allow it, the kernel then encrypts
and decrypts, and SSL_read/SSL_write go on working over it. What a
service got is logged on its first TLS connection.

Reading ahead is left off where the kernel took receiving, which reads
a record at a time. A build whose library has no kernel TLS (wolfSSL,
OpenSSL before 3.0 or without it) warns and ignores the command.
splice() is not used for TLS services yet.

Tested on AlmaLinux 10 (OpenSSL 3.5.8, tls module): both directions
of both legs of a TLS chain in the kernel, the suite passing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vladimir DubrovinandClaude Opus 5.5 committed 2026-10-14 17:29:21 +03:00
1 parent 07fd3083fa
commit d0e88a7b88
6 files changed
+153 -6

No files matched your search

+9
View File
@@ -1588,6 +1588,15 @@ SSL/TLS can be used for:
.BR ssl_client_mode
\fImode\fR - when to establish TLS connection: 0 - on connect (default), 1 - after authentication, 2 - before data, 3 - only for secure parent types (ending with 's')
.br
.BR ssl_ktls
- use kernel TLS (Linux, FreeBSD) for the connections of the services which
follow, where the TLS library, the kernel and the negotiated cipher allow it:
the kernel then encrypts and decrypts the data; \fBssl_noktls\fR (default)
keeps it in 3proxy. Needs OpenSSL 3.0 or later built with kernel TLS
(enable-ktls) and, on Linux, the tls kernel module; receiving with TLS 1.3
needs a later OpenSSL than 3.0. Whether the kernel took sending and receiving is
logged on the first TLS connection of a service. Not supported with wolfSSL.
.br
.BR ssl_certcache
\fI/path/to/cache/\fR - location for the generated MITM certificates cache