本文整理匯總了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