Skip to main content

negotiated_http_version

Function negotiated_http_version 

pub fn negotiated_http_version(
    application_protocol: Option<&Protocol>,
    target_version: Option<Version>,
    negotiated_alpn: Option<&ApplicationProtocol>,
) -> Result<Option<Version>, Box<dyn Error + Sync + Send>>
Available on crate feature tls only.
Expand description

Interpret negotiated ALPN for HTTP and check an explicit target version.

Returns None when the application protocol is absent or non-HTTP, or no ALPN was negotiated. Otherwise rejects unknown HTTP ALPN or a target mismatch. The caller decides where to publish the returned version; a proxy tunnel’s negotiated version must not become the origin’s HTTP version.