You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add an ssl.OP_ENABLE_KTLS option for enabling the use of the kernel TLS #96828
A new ssl.OP_ENABLE_KTLS option for enabling the use of the kernel TLS.
Pitch
Kernel Transport Layer Security (kTLS) can improve performance of programs using TLS by reducing the number of switches between the user space and the kernel space. kTLS allows using the sendfile system call for sending data using TLS. Also, it may offload TLS to network interface controllers.
kTLS is not enabled by default for various reasons which you can find in openssl/openssl#13794. Even if a system supports the feature and OpenSSL was compiled with support for it, Python still has to set an OpenSSL's option SSL_OP_ENABLE_KTLS to use it.
In theory, it is possible to enable the kernel TLS in any Python compiled against OpenSSL 3 using this following code. If all other requirements are met, Python should start writing to and reading from a secure socket using the kernel TLS.
Activity
pythongh-96828: Add an `ssl.OP_ENABLE_KTLS` option
gh-96828: Add an `ssl.OP_ENABLE_KTLS` option (GH-96830)