diff --git a/src/async_impl/client.rs b/src/async_impl/client.rs index 926e21e59..a64869582 100644 --- a/src/async_impl/client.rs +++ b/src/async_impl/client.rs @@ -590,7 +590,11 @@ impl ClientBuilder { tls.alpn_protocols = vec!["h3".into()]; } HttpVersionPref::All => { - tls.alpn_protocols = vec!["h2".into(), "http/1.1".into()]; + tls.alpn_protocols = vec![ + #[cfg(feature = "http2")] + "h2".into(), + "http/1.1".into(), + ]; } }