diff --git a/Cargo.toml b/Cargo.toml index 796d24f..a739599 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,9 +14,6 @@ categories = ["asynchronous", "cryptography", "network-programming"] travis-ci = { repository = "quininer/tokio-rustls" } appveyor = { repository = "quininer/tokio-rustls" } -[features] -danger = [ "rustls/dangerous_configuration" ] - [dependencies] futures = "0.1" tokio-io = "0.1" diff --git a/src/lib.rs b/src/lib.rs index 978eb6c..12cdf53 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,11 +22,6 @@ pub trait ClientConfigExt { fn connect_async(&self, domain: &str, stream: S) -> ConnectAsync where S: AsyncRead + AsyncWrite; - - #[cfg(feature = "danger")] - fn danger_connect_async_without_providing_domain_for_certificate_verification_and_server_name_indication(&self, stream: S) - -> ConnectAsync - where S: AsyncRead + AsyncWrite; } /// Extension trait for the `Arc` type in the `rustls` crate. @@ -53,30 +48,6 @@ impl ClientConfigExt for Arc { { connect_async_with_session(stream, ClientSession::new(self, domain)) } - - #[cfg(feature = "danger")] - fn danger_connect_async_without_providing_domain_for_certificate_verification_and_server_name_indication(&self, stream: S) - -> ConnectAsync - where S: AsyncRead + AsyncWrite - { - use rustls::{ ServerCertVerifier, RootCertStore, Certificate, ServerCertVerified, TLSError }; - - struct NoCertVerifier; - impl ServerCertVerifier for NoCertVerifier { - fn verify_server_cert(&self, _: &RootCertStore, _: &[Certificate], _: &str, _: &[u8]) - -> Result - { - Ok(ServerCertVerified::assertion()) - } - } - - let mut client_config = ClientConfig::new(); - client_config.clone_from(self); - client_config.dangerous() - .set_certificate_verifier(Arc::new(NoCertVerifier)); - - Arc::new(client_config).connect_async("", stream) - } } #[inline] diff --git a/tests/test.rs b/tests/test.rs index ecf659d..86c715e 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -60,7 +60,7 @@ fn start_server(cert: Vec, rsa: PrivateKey) -> SocketAddr { recv.recv().unwrap() } -fn start_client(addr: &SocketAddr, domain: Option<&str>, chain: Option>>) -> io::Result<()> { +fn start_client(addr: &SocketAddr, domain: &str, chain: Option>>) -> io::Result<()> { let mut config = ClientConfig::new(); if let Some(mut chain) = chain { config.root_store.add_pem_file(&mut chain).unwrap(); @@ -72,17 +72,7 @@ fn start_client(addr: &SocketAddr, domain: Option<&str>, chain: Option