From 4faa9d46d670eba07389c61fca9ebb0be4fca472 Mon Sep 17 00:00:00 2001
From: spikecodes <19519553+spikecodes@users.noreply.github.com>
Date: Sun, 21 Nov 2021 22:44:05 -0800
Subject: [PATCH] Fix HTTPS connector
---
src/client.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/client.rs b/src/client.rs
index aa70228..8760eff 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -23,7 +23,7 @@ async fn stream(url: &str, req: &Request
) -> Result, String
let url = Uri::from_str(url).map_err(|_| "Couldn't parse URL".to_string())?;
// Prepare the HTTPS connector.
- let https = hyper_rustls::HttpsConnector::with_native_roots();
+ let https = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_only().enable_http1().build();
// Build the hyper client from the HTTPS connector.
let client: client::Client<_, hyper::Body> = client::Client::builder().build(https);
@@ -63,7 +63,7 @@ async fn stream(url: &str, req: &Request) -> Result, String
fn request(url: String, quarantine: bool) -> Boxed, String>> {
// Prepare the HTTPS connector.
- let https = hyper_rustls::HttpsConnector::with_native_roots();
+ let https = hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build();
// Construct the hyper client from the HTTPS connector.
let client: client::Client<_, hyper::Body> = client::Client::builder().build(https);