From 66effe127ec9193dfeb46d3c950b6f4d8de81800 Mon Sep 17 00:00:00 2001 From: lz1998 <875543533@qq.com> Date: Thu, 23 Jun 2022 21:58:52 +0800 Subject: [PATCH] use hyper-tls --- Cargo.toml | 2 +- src/util/uri_reader.rs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 89a8095..cb153c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ tracing-subscriber = { version = "0.3", features = ["fmt", "local-time"] } time = { version = "0.3", features = ["macros", "local-offset"] } dashmap = "5.2" hyper = { version = "0.14", features = ["client", "http1"] } -hyper-rustls = "0.23" +hyper-tls = { version = "0.5", features = ["vendored"] } chrono = "0.4" xml-rs = "0.8" async-recursion = "1.0.0" diff --git a/src/util/uri_reader.rs b/src/util/uri_reader.rs index 4fb6cfe..37337d1 100644 --- a/src/util/uri_reader.rs +++ b/src/util/uri_reader.rs @@ -17,13 +17,7 @@ pub async fn get_binary(uri: &str) -> RCResult> { } pub async fn http_get(uri: &str) -> RCResult> { - let cli = Client::builder().build::<_, Body>( - hyper_rustls::HttpsConnectorBuilder::new() - .with_native_roots() - .https_or_http() - .enable_http1() - .build(), - ); + let cli = Client::builder().build::<_, Body>(hyper_tls::HttpsConnector::new()); let req = Request::builder().uri(uri).body(Body::empty())?; let resp = cli.request(req).await?; hyper::body::to_bytes(resp.into_body())