Skip to content

Commit 524f615

Browse files
authored
Merge pull request #95 from CryZe/use-alpn-by-default
Use ALPN by default to negotiate for HTTP2
2 parents 8790ded + 201c2d9 commit 524f615

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/connector.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ impl HttpsConnector<HttpConnector> {
3232
let mut http = HttpConnector::new();
3333
http.enforce_http(false);
3434
let mut config = ClientConfig::new();
35-
config.root_store =
36-
rustls_native_certs::load_native_certs().expect("cannot access native cert store");
35+
config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()];
36+
config.root_store = rustls_native_certs::load_native_certs()
37+
.expect("cannot access native cert store");
3738
config.ct_logs = Some(&ct_logs::LOGS);
3839
HttpsConnector {
3940
http,

0 commit comments

Comments
 (0)