diff options
Diffstat (limited to 'src/tls_util.rs')
-rw-r--r-- | src/tls_util.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tls_util.rs b/src/tls_util.rs index 054c35a..91ad31c 100644 --- a/src/tls_util.rs +++ b/src/tls_util.rs @@ -1,21 +1,20 @@ use core::future::Future; use core::task::{Context, Poll}; use std::convert::TryFrom; +use std::io; use std::pin::Pin; use std::sync::Arc; -use std::io; use futures_util::future::*; -use rustls::ServerName; use hyper::client::connect::Connection; use hyper::client::HttpConnector; use hyper::service::Service; use hyper::Uri; use hyper_rustls::MaybeHttpsStream; +use rustls::ServerName; use tokio::io::{AsyncRead, AsyncWrite}; use tokio_rustls::TlsConnector; - #[derive(Clone)] pub struct HttpsConnectorFixedDnsname<T> { http: T, @@ -62,8 +61,7 @@ where let cfg = self.tls_config.clone(); let connecting_future = self.http.call(dst); - let dnsname = - ServerName::try_from(self.fixed_dnsname).expect("Invalid fixed dnsname"); + let dnsname = ServerName::try_from(self.fixed_dnsname).expect("Invalid fixed dnsname"); let f = async move { let tcp = connecting_future.await.map_err(Into::into)?; let connector = TlsConnector::from(cfg); @@ -76,4 +74,3 @@ where f.boxed() } } - |