Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for OpenSSL 3.x SSL_sendfile in mod_tls #1729

Open
Castaglia opened this issue Oct 8, 2023 · 0 comments
Open

Add support for OpenSSL 3.x SSL_sendfile in mod_tls #1729

Castaglia opened this issue Oct 8, 2023 · 0 comments
Assignees
Milestone

Comments

@Castaglia
Copy link
Member

Castaglia commented Oct 8, 2023

The scope of this ticket is to add support/usage of the SSL_sendfile function, available in OpenSSL 3.x, to the mod_tls module.

The SSL_sendfile function makes use of TLS support in the kernel (where available), to increase performance by avoiding the copying of memory buffers from userland to kernel space. This is mostly beneficial for FTPS downloads; it does not benefit FTPS uploads or directory listings.

See:

From looking through the OpenSSL 3.x source code, it looks like they try to use KTLS automatically, where possible. If that is true, then what changes need to happen, if at all, in mod_tls? The answer is that we can be more efficient, for TLS downloads, in mod_xfer. In that module, there is already a code path for using sendfile(2), to send the entire file, when possible. And right now, mod_xfer falls back to send the data, chunk by chunk, for TLS downloads. It would be more efficient if mod_xfer knew that it could send the entire file, for TLS downloads, at once rather than chunk by chunk.

In addition, we may need to set the SSL_OP_ENABLE_KTLS option; see SSL_CTX_set_options.

@Castaglia Castaglia added this to the 1.3.9 milestone Oct 8, 2023
@Castaglia Castaglia self-assigned this Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant