diff --git a/Cargo.lock b/Cargo.lock index f3e5d77a..49082b6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -627,7 +627,6 @@ dependencies = [ "humantime-serde", "hyper 1.1.0", "hyper-rustls", - "hyper-tls 0.6.0", "hyper-util", "indicatif", "lazy_static", @@ -1241,22 +1240,6 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper 1.1.0", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.2" @@ -2357,7 +2340,7 @@ dependencies = [ "http 0.2.11", "http-body 0.4.6", "hyper 0.14.28", - "hyper-tls 0.5.0", + "hyper-tls", "ipnet", "js-sys", "log", diff --git a/Cargo.toml b/Cargo.toml index 30480c6b..8999bcf8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,10 +79,9 @@ openssl = { version = "0.10", features = ["vendored"] } humantime-serde = "1.1.1" leaky-bucket = "1.0.1" hyper = { version = "1.1", features = ["full"] } -hyper-util = { version = "0.1.2", features = ["client-legacy", "tokio", "server-auto", "http1"] } -hyper-tls = "0.6.0" +hyper-util = { version = "0.1.2", features = ["client", "client-legacy", "tokio", "server-auto", "http1", "http2"] } tokio-rustls = "0.25" -hyper-rustls = "0.26" +hyper-rustls = { version = "0.26", features = [ "http1", "http2", "logging" ] } http-body-util = "0.1.0" regex = "1.10.2" http-range-header = "0.4.0" diff --git a/src/proxy/mod.rs b/src/proxy/mod.rs index 8998b15c..6ab9cadc 100644 --- a/src/proxy/mod.rs +++ b/src/proxy/mod.rs @@ -40,7 +40,6 @@ use hyper::server::conn::http1; use hyper::service::service_fn; use hyper::upgrade::Upgraded; use hyper::{Method, Request}; -use hyper_tls::HttpsConnector; use hyper_util::{ client::legacy::Client, rt::{tokio::TokioIo, TokioExecutor}, @@ -620,8 +619,16 @@ async fn proxy_http(request: Request) -> ClientResult) -> ClientResult { - let https = HttpsConnector::new(); - let client = Client::builder(TokioExecutor::new()).build::<_, hyper::body::Incoming>(https); + let https = hyper_rustls::HttpsConnectorBuilder::new() + .with_native_roots()? + .https_or_http() + .enable_http1() + .enable_http2() + .build(); + + let client = Client::builder(TokioExecutor::new()) + .http2_only(true) + .build::<_, hyper::body::Incoming>(https); let response = client.request(request).await?; Ok(response.map(|b| b.map_err(ClientError::from).boxed())) }