Add Acceptor::from_server_config for runtime-built rustls ServerConfig - #942
Open
torinnd wants to merge 1 commit into
Open
Add Acceptor::from_server_config for runtime-built rustls ServerConfig#942torinnd wants to merge 1 commit into
torinnd wants to merge 1 commit into
Conversation
Acceptor::tls_handshake() is public, but an Acceptor could previously only be obtained via TlsSettings::build(), which loads certificates and key from files on disk. Add a constructor taking an already-built rustls ServerConfig, supporting configurations whose key material lives in memory (e.g. fetched from a secrets manager) without writing private keys to disk. This is the same construction TlsSettings::build() already performs in its final step, so no existing behavior changes.
torinnd
force-pushed
the
acceptor-from-server-config
branch
from
July 28, 2026 09:20
0f59f33 to
896d90f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #916
Implements the constructor proposed in #916: Acceptor::from_server_config(Arc). It performs the same construction TlsSettings::build() already does in its final step ( RusTlsAcceptor::from(...)), taking the config as an argument instead of loading certificate and key files. No existing behavior changes, and callbacks: None and offload: None match what build() produces today with no callbacks or handshake offload configured.
Includes a test that builds a ServerConfig by hand, constructs an Acceptor from it, and completes a TLS handshake and HTTP round trip by driving tls_handshake() directly on an accepted TCP stream, with no TlsSettings involved and no certificate files in the handshake path. The test binds port 0 so it runs in constrained environments.