Skip to main content

accept

Function accept 

Source
pub async fn accept<S>(
    config: Arc<ServerConfig>,
    io: S,
) -> Result<(TlsStream<S>, PeerIdentity), PeerError>
where S: AsyncRead + AsyncWrite + Unpin + PeerAddr,
Expand description

Accepts a peer over io, completing the handshake before returning.

A peer that proved its key and is refused by a store-backed pin set is recorded as waiting under the address of io.

ยงErrors

PeerError::Io when the handshake fails; PeerError::refusal says why this side refused the peer certificate, when it did.