本文整理汇总了Python中_ssl._SSLContext.__new__方法的典型用法代码示例。如果您正苦于以下问题:Python _SSLContext.__new__方法的具体用法?Python _SSLContext.__new__怎么用?Python _SSLContext.__new__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类_ssl._SSLContext
的用法示例。
在下文中一共展示了_SSLContext.__new__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __new__
# 需要导入模块: from _ssl import _SSLContext [as 别名]
# 或者: from _ssl._SSLContext import __new__ [as 别名]
def __new__(cls, oid):
return super(_ASN1Object, cls).__new__(cls, *_txt2obj(oid, name=False))
示例2: fromnid
# 需要导入模块: from _ssl import _SSLContext [as 别名]
# 或者: from _ssl._SSLContext import __new__ [as 别名]
def fromnid(cls, nid):
"""Create _ASN1Object from OpenSSL numeric ID
"""
return super(_ASN1Object, cls).__new__(cls, *_nid2obj(nid))
示例3: fromname
# 需要导入模块: from _ssl import _SSLContext [as 别名]
# 或者: from _ssl._SSLContext import __new__ [as 别名]
def fromname(cls, name):
"""Create _ASN1Object from short name, long name or OID
"""
return super(_ASN1Object, cls).__new__(cls, *_txt2obj(name, name=True))
示例4: __new__
# 需要导入模块: from _ssl import _SSLContext [as 别名]
# 或者: from _ssl._SSLContext import __new__ [as 别名]
def __new__(cls, oid):
return super().__new__(cls, *_txt2obj(oid, name=False))
示例5: fromnid
# 需要导入模块: from _ssl import _SSLContext [as 别名]
# 或者: from _ssl._SSLContext import __new__ [as 别名]
def fromnid(cls, nid):
"""Create _ASN1Object from OpenSSL numeric ID
"""
return super().__new__(cls, *_nid2obj(nid))
示例6: fromname
# 需要导入模块: from _ssl import _SSLContext [as 别名]
# 或者: from _ssl._SSLContext import __new__ [as 别名]
def fromname(cls, name):
"""Create _ASN1Object from short name, long name or OID
"""
return super().__new__(cls, *_txt2obj(name, name=True))
示例7: _create
# 需要导入模块: from _ssl import _SSLContext [as 别名]
# 或者: from _ssl._SSLContext import __new__ [as 别名]
def _create(cls, incoming, outgoing, server_side=False,
server_hostname=None, session=None, context=None):
self = cls.__new__(cls)
sslobj = context._wrap_bio(
incoming, outgoing, server_side=server_side,
server_hostname=server_hostname,
owner=self, session=session
)
self._sslobj = sslobj
return self