Skip to content

Commit

Permalink
use hyper-tls
Browse files Browse the repository at this point in the history
  • Loading branch information
lz1998 committed Jun 23, 2022
1 parent a0b6e1a commit 66effe1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 1 addition & 7 deletions src/util/uri_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@ pub async fn get_binary(uri: &str) -> RCResult<Vec<u8>> {
}

pub async fn http_get(uri: &str) -> RCResult<Vec<u8>> {
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())
Expand Down

0 comments on commit 66effe1

Please sign in to comment.