Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/connector/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,19 @@ impl ConnectorBuilder<WantsProtocols1> {
})
}

/// Enable all HTTP versions
///
/// For now, this enables both HTTP 1 and 2. In the future, other supported versions
/// will be enabled as well.
#[cfg(all(feature = "http1", feature = "http2"))]
pub fn enable_all_versions(mut self) -> ConnectorBuilder<WantsProtocols3> {
self.0.tls_config.alpn_protocols = vec![b"h2".to_vec()];
ConnectorBuilder(WantsProtocols3 {
inner: self.0,
enable_http1: true,
})
}

/// Override server name for the TLS stack
///
/// By default, for each connection hyper-rustls will extract host portion
Expand Down