Expand description
Async TLS client for the Moirai runtime.
Drives the sans-I/O rustls state machine (via the runtime-agnostic
futures_rustls adapter) over a Moirai async socket — no Tokio. Moirai’s
moirai_async::io::AsyncRead/AsyncWrite
traits are signature-identical to futures_io, so the bridge is two zero-cost
newtypes; all TLS cryptography and record framing are delegated to the audited
rustls stack (ADR-015 — moirai owns transport, not crypto reimplementation).
use moirai_tls::{TlsConnector, ServerName};
let connector = TlsConnector::with_webpki_roots();
let domain = ServerName::try_from("example.com").unwrap();
let _tls = connector.connect(domain, sock).await.unwrap();Re-exports§
pub use futures_rustls::rustls;
Structs§
- TlsConnector
- Client TLS connector wrapping a shared
rustls::ClientConfig. - ToFutures
Io - Zero-cost adapter exposing a Moirai async stream as a
futures_iostream. - ToMoirai
Io - Zero-cost adapter exposing a
futures_iostream as a Moirai async stream.
Enums§
- Server
Name - Server name used for SNI and certificate validation. Encodes ways a client can know the expected name of the server.
Functions§
- client_
config_ with_ roots - Construct a pure-Rust RustCrypto-backed
ClientConfigwith safe default protocol versions trustingroots. Usesmoirai_crypto::providerinstead ofring— zero C dependencies. Shared byTlsConnector::with_webpki_rootsand tests that supply a custom root (self-signed) store.
Type Aliases§
- TlsStream
- A negotiated client-side TLS stream over a Moirai async socket
S.