當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。