Skip to content

feat: add DaemonStream abstraction for plain TCP and TLS connections#5075

Open
oferchen wants to merge 2 commits into
masterfrom
feat/tls-7-daemon-stream-abstraction
Open

feat: add DaemonStream abstraction for plain TCP and TLS connections#5075
oferchen wants to merge 2 commits into
masterfrom
feat/tls-7-daemon-stream-abstraction

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Introduce DaemonStream enum (Plain(TcpStream) / Tls(StreamOwned)) that implements Read + Write + Debug
  • Update all daemon call sites from raw TcpStream to DaemonStream, enabling transparent TLS upgrades
  • Add wrap_accepted_stream() helper that performs TLS handshake when TlsAcceptor is configured
  • TLS variant gated behind #[cfg(feature = "daemon-tls")] - zero cost for default builds

Test plan

  • CI fmt+clippy passes (DaemonStream type + all call-site changes)
  • nextest (stable) passes - daemon runtime tests exercise new stream type
  • Windows, macOS, Linux musl stable pass - DaemonStream compiles cross-platform
  • --features daemon-tls CI cell validates TLS variant compilation

Introduce DaemonStream enum that wraps either a plain TcpStream or a
rustls TLS connection behind a unified Read + Write interface. All
daemon call sites now accept DaemonStream instead of raw TcpStream,
enabling transparent TLS upgrades when the daemon-tls feature is active.

The TLS variant is gated behind #[cfg(feature = "daemon-tls")] so
default builds pay zero cost. Includes wrap_accepted_stream() helper
that performs TLS handshake or wraps as Plain based on TlsAcceptor
availability.
@github-actions github-actions Bot added the enhancement New feature or request label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant