pub struct TlsClientFilter { /* private fields */ }Expand description
Encrypts and decrypts a client connection using rustls.
Construct through Self::create or super::TlsConnector. The filter
exposes the metadata described in the super module and exchanges
close_notify during shutdown, accepting transport EOF if the peer has
already disconnected.
Implementations§
Source§impl TlsClientFilter
impl TlsClientFilter
Sourcepub async fn create<F>(
io: Io<F>,
cfg: Arc<ClientConfig>,
domain: ServerName<'static>,
) -> Result<Io<Layer<TlsClientFilter, F>>, Error>where
F: Filter,
pub async fn create<F>(
io: Io<F>,
cfg: Arc<ClientConfig>,
domain: ServerName<'static>,
) -> Result<Io<Layer<TlsClientFilter, F>>, Error>where
F: Filter,
Installs a client filter and drives its handshake to completion.
domain supplies the name used by rustls verification and, for DNS names,
SNI according to cfg. Existing filters are preserved. The session’s
buffering limit is initialized from the I/O write-page capacity.
No handshake timeout or concurrency limit is applied here. Use
super::TlsConnector for the service-configured timeout.
§Errors
Returns an error if session creation, certificate verification, protocol
negotiation, or transport I/O fails. An incomplete handshake followed by
transport EOF returns io::ErrorKind::UnexpectedEof.
Trait Implementations§
Source§impl Debug for TlsClientFilter
impl Debug for TlsClientFilter
Source§impl FilterLayer for TlsClientFilter
impl FilterLayer for TlsClientFilter
Source§fn query(&self, id: TypeId) -> Option<Box<dyn Any>>
fn query(&self, id: TypeId) -> Option<Box<dyn Any>>
Returns None while the session is busy, for example when a
certificate verifier queries its own connection during the handshake.
Source§fn process_read_buf(&self, buf: &FilterBuf<'_>) -> Result<(), Error>
fn process_read_buf(&self, buf: &FilterBuf<'_>) -> Result<(), Error>
Decrypts input, releasing the session borrow before a peer-close notification can reenter.