本文整理汇总了Python中ssl.MemoryBIO方法的典型用法代码示例。如果您正苦于以下问题:Python ssl.MemoryBIO方法的具体用法?Python ssl.MemoryBIO怎么用?Python ssl.MemoryBIO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ssl
的用法示例。
在下文中一共展示了ssl.MemoryBIO方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def __init__(self, context, server_side, server_hostname=None):
"""
The *context* argument specifies the ssl.SSLContext to use.
The *server_side* argument indicates whether this is a server side or
client side transport.
The optional *server_hostname* argument can be used to specify the
hostname you are connecting to. You may only specify this parameter if
the _ssl module supports Server Name Indication (SNI).
"""
self._context = context
self._server_side = server_side
self._server_hostname = server_hostname
self._state = _UNWRAPPED
self._incoming = ssl.MemoryBIO()
self._outgoing = ssl.MemoryBIO()
self._sslobj = None
self._need_ssldata = False
self._handshake_cb = None
self._shutdown_cb = None
示例2: __init__
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def __init__(self, writer, reader, pem_file):
"""@param: writer and reader are asyncio stream writer and reader objects"""
self._tlsInBuff = ssl.MemoryBIO()
self._tlsOutBuff = ssl.MemoryBIO()
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_1)
ctx.set_ciphers('RSA:!aNULL')
ctx.check_hostname = False
ctx.load_cert_chain(pem_file)
self._tlsObj = ctx.wrap_bio(
self._tlsInBuff, self._tlsOutBuff, server_side=True)
self.writer = writer
self.reader = reader
示例3: __init__
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def __init__(self):
"""
initialize a new storage queue
"""
self.memorybio = ssl.MemoryBIO()
示例4: _is_sslproto_available
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def _is_sslproto_available():
return hasattr(ssl, "MemoryBIO")
# States of an _SSLPipe.
示例5: _make_legacy_ssl_transport
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def _make_legacy_ssl_transport(self, rawsock, protocol, sslcontext,
waiter, *,
server_side=False, server_hostname=None,
extra=None, server=None):
# Use the legacy API: SSL_write, SSL_read, etc. The legacy API is used
# on Python 3.4 and older, when ssl.MemoryBIO is not available.
return _SelectorSslTransport(
self, rawsock, protocol, sslcontext, waiter,
server_side, server_hostname, extra, server)
示例6: test_create_ssl_connection
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def test_create_ssl_connection(self):
raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
示例7: test_create_server_ssl
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def test_create_server_ssl(self):
raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
示例8: test_create_server_ssl_match_failed
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def test_create_server_ssl_match_failed(self):
raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
示例9: test_create_server_ssl_verified
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def test_create_server_ssl_verified(self):
raise unittest.SkipTest("need python 3.5 (ssl.MemoryBIO)")
示例10: __init__
# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def __init__(self, maxlen=-1):
""" Creates StreamReader instance.
Params:
maxlen - maximal allowed netstring length.
"""
self._maxlen = maxlen
self._incoming = ssl.MemoryBIO()
self._fetcher = None