From 021851afd424deba00530544a43ba3ac9c64f0a2 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Fri, 18 Jan 2019 11:53:56 -0800 Subject: [PATCH] Enable h2 ALPN with rustls-tls backend --- Cargo.toml | 2 +- src/async_impl/client.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a7bd8bf..541d072 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ tokio-timer = "0.2.6" # a minimum version so trust-dns-resolver compiles trust-dns-resolver = { version = "0.10", optional = true } url = "1.2" uuid = { version = "0.7", features = ["v4"] } -hyper-rustls = { version = "0.15", optional = true } +hyper-rustls = { version = "0.15.1", optional = true } tokio-rustls = { version = "0.8", optional = true } webpki-roots = { version = "0.15", optional = true } rustls = { version = "0.14", features = ["dangerous_configuration"], optional = true } diff --git a/src/async_impl/client.rs b/src/async_impl/client.rs index edaaba9..da6fa78 100644 --- a/src/async_impl/client.rs +++ b/src/async_impl/client.rs @@ -142,6 +142,10 @@ impl ClientBuilder { use ::tls::NoVerifier; let mut tls = ::rustls::ClientConfig::new(); + tls.set_protocols(&[ + "h2".into(), + "http/1.1".into(), + ]); tls.root_store.add_server_trust_anchors(&webpki_roots::TLS_SERVER_ROOTS); if !config.certs_verification {