gaffer_connector_pki.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:gaffer-tools 作者: gchq 项目源码 文件源码
def get_ssl_context(self, protocol=None):
        """
        This method returns a SSL context based on the file that was specified
        when this object was created.

        Arguments:
         - An optional protocol. SSLv2 is used by default.

        Returns:
         - The SSL context
        """

        # Validate the arguments
        if protocol is None:
            protocol = ssl.PROTOCOL_SSLv2

        # Create an SSL context from the stored file and password.
        ssl_context = ssl.SSLContext(protocol)
        ssl_context.load_cert_chain(self._cert_filename,
                                    password=self._password)

        # Return the context
        return ssl_context
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号