コード例 #1
0
    def set_credentials(self, cert_file, key_file, password):
        """
        Set the certificate that identifies the local node to the remote.

        This certificate establishes the identity for the local node for all :class:`SSL` sessions
        created from this domain.  It will be sent to the remote if the remote needs to verify
        the identity of this node.  This may be used for both SSL servers and SSL clients (if
        client authentication is required by the server).

        .. note:: This setting effects only those :class:`SSL` objects created after this call
            returns.  :class:`SSL` objects created before invoking this method will use the domain's
            previous setting.

        :param cert_file: Specifier for the file/database containing the identifying
               certificate. For Openssl users, this is a PEM file. For Windows SChannel
               users, this is the PKCS#12 file or system store.
        :type cert_file: ``str``
        :param key_file: An optional key to access the identifying certificate. For
               Openssl users, this is an optional PEM file containing the private key
               used to sign the certificate. For Windows SChannel users, this is the
               friendly name of the self-identifying certificate if there are multiple
               certificates in the store.
        :type key_file: ``str``
        :param password: The password used to sign the key, else ``None`` if key is not
               protected.
        :type password: ``str`` 
        :return: 0 on success
        :rtype: ``int``
        :raise: :exc:`SSLException` if there is any Proton error
        """
        return self._check(pn_ssl_domain_set_credentials(self._domain,
                                                         cert_file, key_file,
                                                         password))
コード例 #2
0
ファイル: _transport.py プロジェクト: apache/qpid-proton
 def set_credentials(self, cert_file, key_file, password):
     return self._check(pn_ssl_domain_set_credentials(self._domain,
                                                      cert_file, key_file,
                                                      password))
コード例 #3
0
ファイル: _transport.py プロジェクト: archerabi/qpid-proton
 def set_credentials(self, cert_file, key_file, password):
     return self._check(
         pn_ssl_domain_set_credentials(self._domain, cert_file, key_file,
                                       password))