本文整理汇总了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(), '')
示例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(), '')