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


Python ssl.MemoryBIO方法代码示例

本文整理汇总了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 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:23,代码来源:sslproto.py

示例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 
开发者ID:johnnykv,项目名称:heralding,代码行数:14,代码来源:tls.py

示例3: __init__

# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def __init__(self):
        """
        initialize a new storage queue
        """

        self.memorybio = ssl.MemoryBIO() 
开发者ID:SySS-Research,项目名称:outis,代码行数:8,代码来源:dataqueue.py

示例4: _is_sslproto_available

# 需要导入模块: import ssl [as 别名]
# 或者: from ssl import MemoryBIO [as 别名]
def _is_sslproto_available():
    return hasattr(ssl, "MemoryBIO")


# States of an _SSLPipe. 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:7,代码来源:sslproto.py

示例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) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:11,代码来源:selector_events.py

示例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)") 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:4,代码来源:test_events.py

示例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)") 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:4,代码来源:test_events.py

示例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)") 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:4,代码来源:test_events.py

示例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)") 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:4,代码来源:test_events.py

示例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 
开发者ID:Snawoot,项目名称:postfix-mta-sts-resolver,代码行数:12,代码来源:netstring.py


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