From ea050c7045764f69a6dd25a2b0c75186dddfc50e Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 24 Jan 2022 20:55:26 +0100 Subject: Actually that was quite a stupid way of handling timeouts --- src/tls_util.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/tls_util.rs') diff --git a/src/tls_util.rs b/src/tls_util.rs index 91ad31c..836f41e 100644 --- a/src/tls_util.rs +++ b/src/tls_util.rs @@ -23,8 +23,11 @@ pub struct HttpsConnectorFixedDnsname { } type BoxError = Box; impl HttpsConnectorFixedDnsname { - pub fn new(mut tls_config: rustls::ClientConfig, fixed_dnsname: &'static str) -> Self { - let mut http = HttpConnector::new(); + pub fn new( + mut tls_config: rustls::ClientConfig, + fixed_dnsname: &'static str, + mut http: HttpConnector, + ) -> Self { http.enforce_http(false); tls_config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()]; Self { -- cgit v1.2.3