Skip to main content

Module rustls

Module rustls 

Source
Expand description

TLS services and filters backed by rustls.

TlsAcceptor and TlsConnector apply crate::TlsConfig to service handshakes. TlsClientFilter::create and TlsServerFilter::create upgrade existing I/O directly; only the server constructor takes an explicit timeout. Neither direct constructor applies acceptor concurrency backpressure.

Configure certificates, verification, ALPN, and the crypto provider on the supplied rustls configuration. The filters do not install trust roots or override those settings.

Queries expose PeerCert, PeerCertChain, their backend-independent DER equivalents, crate::TlsVersion, crate::TlsCipher, and ntex_io::types::HttpProtocol. Server filters additionally expose received crate::Servername. Only h2 selects HTTP/2; absent or other ALPN values report HTTP/1.

Structs§

PeerCert
The peer’s end-entity certificate as a rustls certificate value.
PeerCertChain
The certificate chain presented by the peer, with its leaf first.
TlsAcceptor
Upgrades existing I/O connections to server-side TLS using rustls.
TlsClientFilter
Encrypts and decrypts a client connection using rustls.
TlsConnector
Opens a transport and upgrades it to client-side TLS using rustls.
TlsServerFilter
Encrypts and decrypts a server connection using rustls.

Functions§

certified_key
Packages an identity for a rustls client/server certificate resolver.
client_certified_key
Packages an already ordered client identity for a rustls certificate resolver.