serverside

Function serverside 

Source
pub async fn serverside(
    io: &mut (impl BytesStreamSink + ExportKeyingMaterial),
    client_auth_header: Option<HeaderValue>,
) -> Result<SuccessfulAuthentication, Error>
Available on crate feature server only.
Expand description

Runs the server side of the handshaking protocol.

See the module documentation for an overview of the handshaking protocol.

This takes rng to generate cryptographic randomness for the authentication challenge.

This also takes the client_auth_header, if present, to perform authentication without requiring sending a challenge, saving a round-trip, if possible.

If this fails, the protocol falls back to doing a normal extra round trip with a challenge.

The return value SuccessfulAuthentication still needs to be resolved by calling SuccessfulAuthentication::authorize_if to finish the whole authorization protocol (otherwise the client won’t be notified about auth success or failure).