Skip to main content

rustls

Function rustls 

Source
pub fn rustls<F, S, St>(
    config: ServerConfig,
    protos: &[&str],
    service: impl IntoService<S, St, Io<Layer<TlsServerFilter, F>>>,
) -> impl Service<St, Io<F>, Res = S::Res, Error = TlsError<S::Error>>
where F: Filter, S: Service<St, Io<Layer<TlsServerFilter, F>>>,
Expand description

Creates a rustls-based HTTP service.

Pass the supported ALPN protocol identifiers in protos to enable HTTP/2 negotiation. If the configuration already contains ALPN protocols, they are preserved. TLS failures and inner-service failures are mapped to the corresponding TlsError variants.