pub fn connect<S>(&self, domain: &str, stream: S) -> Result<TlsStream<S>, HandshakeError<S>>
    where
        S: io::Read + io::Write,
    {
        let mut ssl = self
            .connector
            .configure()?
            .use_server_name_indication(self.use_sni)
            .verify_hostname(!self.accept_invalid_hostnames);

        if self.accept_invalid_certs {
            ssl.set_verify(SslVerifyMode::NONE);
        }

        Ok(TlsStream(ssl.connect(domain, stream)?))
    }
/// Initiates a TLS handshake.
///
/// The provided domain will be used for both SNI and certificate hostname
/// validation.
///
/// If the socket is nonblocking and a `WouldBlock` error is returned during
/// the handshake, a `HandshakeError::WouldBlock` error will be returned
/// which can be used to restart the handshake when the socket is ready
/// again.
///
/// The domain is ignored if both SNI and hostname verification are
/// disabled.
Initiates a TLS handshake.
The provided domain will be used for both SNI and certificate hostname
validation.

If the socket is nonblocking and a `WouldBlock` error is returned during
the handshake, a `HandshakeError::WouldBlock` error will be returned
which can be used to restart the handshake when the socket is ready
again.

The domain is ignored if both SNI and hostname verification are
disabled.
Initiates a TLS handshake . The provided domain will be used for both SNI and certificate hostname validation . If the socket is nonblocking and a ` WouldBlock ` error is returned during the handshake a ` HandshakeError :: WouldBlock ` error will be returned which can be used to restart the handshake when the socket is ready again . The domain is ignored if both SNI and hostname verification are disabled .
pub fn connect<S>(&self, domain: &str, stream: S) -> Result<TlsStream<S>, HandshakeError<S>>
    where
        S: io::Read + io::Write,
    {
        let mut ssl = self
            .connector
            .configure()?
            .use_server_name_indication(self.use_sni)
            .verify_hostname(!self.accept_invalid_hostnames);
        if self.accept_invalid_certs {
            ssl.set_verify(SslVerifyMode::NONE);
        }
        Ok(TlsStream(ssl.connect(domain, stream)?))
    }
pub fn connect < S > ( & self , domain : & str , stream : S ) -> Result < TlsStream < S > , HandshakeError < S > > where S : io :: Read + io :: Write , { let mut ssl = self . connector . configure ( ) ? . use_server_name_indication ( self . use_sni ) . verify_hostname ( ! self . accept_invalid_hostnames ) ; if self . accept_invalid_certs { ssl . set_verify ( SslVerifyMode :: NONE ) ; } Ok ( TlsStream ( ssl . connect ( domain , stream ) ? ) ) }
Initiates a TLS handshake.
Initiates a TLS handshake .
&self
domain
&str
stream
S
&self
domain
&str
stream
S