diff options
Diffstat (limited to 'src/reverse_proxy.rs')
-rw-r--r-- | src/reverse_proxy.rs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/reverse_proxy.rs b/src/reverse_proxy.rs index 10f463c..7b0f261 100644 --- a/src/reverse_proxy.rs +++ b/src/reverse_proxy.rs @@ -1,11 +1,11 @@ //! Copied from https://github.com/felipenoris/hyper-reverse-proxy //! See there for original Copyright notice -use std::sync::Arc; use std::convert::TryInto; -use std::time::SystemTime; use std::net::IpAddr; use std::str::FromStr; +use std::sync::Arc; +use std::time::SystemTime; use anyhow::Result; use log::*; @@ -13,9 +13,9 @@ use log::*; use http::header::HeaderName; use hyper::header::{HeaderMap, HeaderValue}; use hyper::{Body, Client, Request, Response, Uri}; -use rustls::{Certificate, ServerName}; -use rustls::client::{ServerCertVerifier, ServerCertVerified}; use lazy_static::lazy_static; +use rustls::client::{ServerCertVerified, ServerCertVerifier}; +use rustls::{Certificate, ServerName}; use crate::tls_util::HttpsConnectorFixedDnsname; @@ -175,16 +175,14 @@ struct DontVerifyServerCert; impl ServerCertVerifier for DontVerifyServerCert { fn verify_server_cert( - &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], - _server_name: &ServerName, - _scts: &mut dyn Iterator<Item = &[u8]>, - _ocsp_response: &[u8], - _now: SystemTime - ) -> Result<ServerCertVerified, rustls::Error> { + &self, + _end_entity: &Certificate, + _intermediates: &[Certificate], + _server_name: &ServerName, + _scts: &mut dyn Iterator<Item = &[u8]>, + _ocsp_response: &[u8], + _now: SystemTime, + ) -> Result<ServerCertVerified, rustls::Error> { Ok(ServerCertVerified::assertion()) } } - - |