当前位置: 首页>>代码示例>>Python>>正文


Python Err.get_error_code方法代码示例

本文整理汇总了Python中M2Crypto.Err.get_error_code方法的典型用法代码示例。如果您正苦于以下问题:Python Err.get_error_code方法的具体用法?Python Err.get_error_code怎么用?Python Err.get_error_code使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在M2Crypto.Err的用法示例。


在下文中一共展示了Err.get_error_code方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: set_session_id_ctx

# 需要导入模块: from M2Crypto import Err [as 别名]
# 或者: from M2Crypto.Err import get_error_code [as 别名]
    def set_session_id_ctx(self, id):
        # type: (bytes) -> None
        """Sets the session id for the SSL.Context w/in a session can be reused.

        @param id: Sessions are generated within a certain context. When
                   exporting/importing sessions with
                   i2d_SSL_SESSION/d2i_SSL_SESSION it would be possible,
                   to re-import a session generated from another context
                   (e.g. another application), which might lead to
                   malfunctions. Therefore each application must set its
                   own session id context sid_ctx which is used to
                   distinguish the contexts and is stored in exported
                   sessions. The sid_ctx can be any kind of binary data
                   with a given length, it is therefore possible to use
                   e.g. the name of the application and/or the hostname
                   and/or service name.
        """
        ret = m2.ssl_ctx_set_session_id_context(self.ctx, id)
        if not ret:
            raise Err.SSLError(Err.get_error_code(), '')
开发者ID:appknox,项目名称:m2crypto,代码行数:22,代码来源:Context.py

示例2: set_session_id_ctx

# 需要导入模块: from M2Crypto import Err [as 别名]
# 或者: from M2Crypto.Err import get_error_code [as 别名]
 def set_session_id_ctx(self, id):
     ret = m2.ssl_ctx_set_session_id_context(self.ctx, id)
     if not ret:
         raise Err.SSLError(Err.get_error_code(), '')
开发者ID:rodrigc,项目名称:m2crypto,代码行数:6,代码来源:Context.py


注:本文中的M2Crypto.Err.get_error_code方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。