(self, key_file=None, cert_file=None,
                 cert_reqs=None, key_password=None, ca_certs=None,
                 assert_hostname=None, assert_fingerprint=None,
                 ca_cert_dir=None)
This method should only be called once, before the connection is used.
This method should only be called once, before the connection is used.
This method should only be called once before the connection is used .
def set_cert(self, key_file=None, cert_file=None,
                 cert_reqs=None, key_password=None, ca_certs=None,
                 assert_hostname=None, assert_fingerprint=None,
                 ca_cert_dir=None):
        """
        This method should only be called once, before the connection is used.
        """
        # If cert_reqs is not provided we'll assume CERT_REQUIRED unless we also
        # have an SSLContext object in which case we'll use its verify_mode.
        if cert_reqs is None:
            if self.ssl_context is not None:
                cert_reqs = self.ssl_context.verify_mode
            else:
                cert_reqs = resolve_cert_reqs(None)

        self.key_file = key_file
        self.cert_file = cert_file
        self.cert_reqs = cert_reqs
        self.key_password = key_password
        self.assert_hostname = assert_hostname
        self.assert_fingerprint = assert_fingerprint
        self.ca_certs = ca_certs and os.path.expanduser(ca_certs)
        self.ca_cert_dir = ca_cert_dir and os.path.expanduser(ca_cert_dir)
def set_cert ( self , key_file = None , cert_file = None , cert_reqs = None , key_password = None , ca_certs = None , assert_hostname = None , assert_fingerprint = None , ca_cert_dir = None ) : # If cert_reqs is not provided we'll assume CERT_REQUIRED unless we also # have an SSLContext object in which case we'll use its verify_mode. if cert_reqs is None : if self . ssl_context is not None : cert_reqs = self . ssl_context . verify_mode else : cert_reqs = resolve_cert_reqs ( None ) self . key_file = key_file self . cert_file = cert_file self . cert_reqs = cert_reqs self . key_password = key_password self . assert_hostname = assert_hostname self . assert_fingerprint = assert_fingerprint self . ca_certs = ca_certs and os . path . expanduser ( ca_certs ) self . ca_cert_dir = ca_cert_dir and os . path . expanduser ( ca_cert_dir )