diff --git a/Cargo.toml b/Cargo.toml index b347b4f..0cf0afe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,3 +34,6 @@ version = "0.1.5" [dev-dependencies] env_logger = "0.5.3" + +[patch.crates-io] +native-tls = { git = "https://github.com/sfackler/rust-native-tls.git" } diff --git a/src/client.rs b/src/client.rs index 2326ac7..fa4369d 100644 --- a/src/client.rs +++ b/src/client.rs @@ -25,11 +25,11 @@ mod encryption { match mode { Mode::Plain => Ok(StreamSwitcher::Plain(stream)), Mode::Tls => { - let connector = TlsConnector::builder()?.build()?; + let connector = TlsConnector::builder().build()?; connector.connect(domain, stream) .map_err(|e| match e { TlsHandshakeError::Failure(f) => f.into(), - TlsHandshakeError::Interrupted(_) => panic!("Bug: TLS handshake not blocked"), + TlsHandshakeError::WouldBlock(_) => panic!("Bug: TLS handshake not blocked"), }) .map(StreamSwitcher::Tls) }