Skip to content

Commit 72baf15

Browse files
committed
Use ALPN by default to negotiate for HTTP2
Hyper supports HTTP2, so hyper-rustls should use ALPN to negotiate for HTTP2 by default.
1 parent bf48901 commit 72baf15

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/connector.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ impl HttpsConnector<HttpConnector> {
2828
let mut http = HttpConnector::new();
2929
http.enforce_http(false);
3030
let mut config = ClientConfig::new();
31+
config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()];
3132
config.root_store = rustls_native_certs::load_native_certs()
3233
.expect("cannot access native cert store");
3334
config.ct_logs = Some(&ct_logs::LOGS);

0 commit comments

Comments
 (0)