diff options
author | Alex Auvolat <alex@adnab.me> | 2022-01-25 17:01:39 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-01-25 17:01:39 +0100 |
commit | b1ac01f53ec110438e8be8ab7716e9d7b6ebb7fe (patch) | |
tree | 5867683287e04bd69e93ad21ad1f432c9794a63d /src/tls_util.rs | |
parent | ea050c7045764f69a6dd25a2b0c75186dddfc50e (diff) | |
download | tricot-b1ac01f53ec110438e8be8ab7716e9d7b6ebb7fe.tar.gz tricot-b1ac01f53ec110438e8be8ab7716e9d7b6ebb7fe.zip |
Try to fix duplicate Host header issuedocker-34
- disable http2 to backend connections even when using tls
- forbid hyper from adding a host header
Diffstat (limited to 'src/tls_util.rs')
-rw-r--r-- | src/tls_util.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tls_util.rs b/src/tls_util.rs index 836f41e..c80dcf8 100644 --- a/src/tls_util.rs +++ b/src/tls_util.rs @@ -21,7 +21,9 @@ pub struct HttpsConnectorFixedDnsname<T> { tls_config: Arc<rustls::ClientConfig>, fixed_dnsname: &'static str, } + type BoxError = Box<dyn std::error::Error + Send + Sync>; + impl HttpsConnectorFixedDnsname<HttpConnector> { pub fn new( mut tls_config: rustls::ClientConfig, @@ -29,7 +31,7 @@ impl HttpsConnectorFixedDnsname<HttpConnector> { mut http: HttpConnector, ) -> Self { http.enforce_http(false); - tls_config.alpn_protocols = vec![b"h2".to_vec(), b"http/1.1".to_vec()]; + tls_config.alpn_protocols = vec![b"http/1.1".to_vec()]; Self { http, tls_config: Arc::new(tls_config), @@ -37,6 +39,7 @@ impl HttpsConnectorFixedDnsname<HttpConnector> { } } } + impl<T> Service<Uri> for HttpsConnectorFixedDnsname<T> where T: Service<Uri>, |