Loading openssl/src/ssl/connector.rs +13 −6 Original line number Diff line number Diff line Loading @@ -168,13 +168,10 @@ impl ConnectConfiguration { self.verify_hostname = verify_hostname; } /// Initiates a client-side TLS session on a stream. /// Returns an `Ssl` configured to connect to the provided domain. /// /// The domain is used for SNI and hostname verification if enabled. pub fn connect<S>(mut self, domain: &str, stream: S) -> Result<SslStream<S>, HandshakeError<S>> where S: Read + Write, { pub fn into_ssl(mut self, domain: &str) -> Result<Ssl, ErrorStack> { if self.sni { self.ssl.set_hostname(domain)?; } Loading @@ -183,7 +180,17 @@ impl ConnectConfiguration { setup_verify_hostname(&mut self.ssl, domain)?; } self.ssl.connect(stream) Ok(self.ssl) } /// Initiates a client-side TLS session on a stream. /// /// The domain is used for SNI and hostname verification if enabled. pub fn connect<S>(self, domain: &str, stream: S) -> Result<SslStream<S>, HandshakeError<S>> where S: Read + Write, { self.into_ssl(domain)?.connect(stream) } } Loading Loading
openssl/src/ssl/connector.rs +13 −6 Original line number Diff line number Diff line Loading @@ -168,13 +168,10 @@ impl ConnectConfiguration { self.verify_hostname = verify_hostname; } /// Initiates a client-side TLS session on a stream. /// Returns an `Ssl` configured to connect to the provided domain. /// /// The domain is used for SNI and hostname verification if enabled. pub fn connect<S>(mut self, domain: &str, stream: S) -> Result<SslStream<S>, HandshakeError<S>> where S: Read + Write, { pub fn into_ssl(mut self, domain: &str) -> Result<Ssl, ErrorStack> { if self.sni { self.ssl.set_hostname(domain)?; } Loading @@ -183,7 +180,17 @@ impl ConnectConfiguration { setup_verify_hostname(&mut self.ssl, domain)?; } self.ssl.connect(stream) Ok(self.ssl) } /// Initiates a client-side TLS session on a stream. /// /// The domain is used for SNI and hostname verification if enabled. pub fn connect<S>(self, domain: &str, stream: S) -> Result<SslStream<S>, HandshakeError<S>> where S: Read + Write, { self.into_ssl(domain)?.connect(stream) } } Loading