Skip to main content

accept_with

Function accept_with 

Source
pub async fn accept_with<S>(
    io: S,
    select: impl FnOnce(&ClientHello<'_>) -> Arc<ServerConfig>,
) -> Result<(TlsStream<S>, PeerIdentity), PeerError>
where S: AsyncRead + AsyncWrite + Unpin + PeerAddr,
Expand description

Accepts a peer over io, choosing the configuration from the ClientHello (for example by its offered ALPN protocols), so one port can serve peers and other clients.

ยงErrors

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