(self)
Initializes the SSL connection.
Initializes the SSL connection.
Initializes the SSL connection .
def init_ssl(self):
        """
        Initializes the SSL connection.
        """
        self._check_closed()
        # Get a context
        self._ctx = SSL.Context(self._ssl_method)
        if self._trusted_certs:
            # We have been supplied with trusted CA certs
            for f in self._trusted_certs:
                self._ctx.load_verify_locations(f)
        else:
            # Reset the verify flags
            self._ssl_verify_flags = 0

        self._ctx.set_verify(self._ssl_verify_flags, ssl_verify_callback)
        if hasattr(SSL, "OP_DONT_INSERT_EMPTY_FRAGMENTS"):
            # Certain SSL implementations break when empty fragments are
            # initially sent (even if sending them is compliant to 
            # SSL 3.0 and TLS 1.0 specs). Play it safe and disable this
            # feature (openssl 0.9.6e and later)
            self._ctx.set_options(SSL.OP_DONT_INSERT_EMPTY_FRAGMENTS)

        # Init the connection
        self._connection = SSL.Connection(self._ctx, self._sock)
        # Place the connection in client mode
        self._connection.set_connect_state()
def init_ssl ( self ) : self . _check_closed ( ) # Get a context self . _ctx = SSL . Context ( self . _ssl_method ) if self . _trusted_certs : # We have been supplied with trusted CA certs for f in self . _trusted_certs : self . _ctx . load_verify_locations ( f ) else : # Reset the verify flags self . _ssl_verify_flags = 0 self . _ctx . set_verify ( self . _ssl_verify_flags , ssl_verify_callback ) if hasattr ( SSL , "OP_DONT_INSERT_EMPTY_FRAGMENTS" ) : # Certain SSL implementations break when empty fragments are # initially sent (even if sending them is compliant to  # SSL 3.0 and TLS 1.0 specs). Play it safe and disable this # feature (openssl 0.9.6e and later) self . _ctx . set_options ( SSL . OP_DONT_INSERT_EMPTY_FRAGMENTS ) # Init the connection self . _connection = SSL . Connection ( self . _ctx , self . _sock ) # Place the connection in client mode self . _connection . set_connect_state ( )