summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/test_utils.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-13 23:19:09 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-13 23:19:09 (GMT)
commit231b404cb026649d4b7172e75ac394ef558efe60 (patch)
tree6d647c68ec4583834213355cc8e21cf67987b2c5 /Lib/asyncio/test_utils.py
parent9036e49ba1acdd49ed7aa86a228a2657ca72c336 (diff)
downloadcpython-231b404cb026649d4b7172e75ac394ef558efe60.zip
cpython-231b404cb026649d4b7172e75ac394ef558efe60.tar.gz
cpython-231b404cb026649d4b7172e75ac394ef558efe60.tar.bz2
Issue #22560: New SSL implementation based on ssl.MemoryBIO
The new SSL implementation is based on the new ssl.MemoryBIO which is only available on Python 3.5. On Python 3.4 and older, the legacy SSL implementation (using SSL_write, SSL_read, etc.) is used. The proactor event loop only supports the new implementation. The new asyncio.sslproto module adds _SSLPipe, SSLProtocol and _SSLProtocolTransport classes. _SSLPipe allows to "wrap" or "unwrap" a socket (switch between cleartext and SSL/TLS). Patch written by Antoine Pitrou. sslproto.py is based on gruvi/ssl.py of the gruvi project written by Geert Jansen. This change adds SSL support to ProactorEventLoop on Python 3.5 and newer! It becomes also possible to implement STARTTTLS: switch a cleartext socket to SSL.
Diffstat (limited to 'Lib/asyncio/test_utils.py')
-rw-r--r--Lib/asyncio/test_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/asyncio/test_utils.py b/Lib/asyncio/test_utils.py
index 3e5eee5..180bafa 100644
--- a/Lib/asyncio/test_utils.py
+++ b/Lib/asyncio/test_utils.py
@@ -434,3 +434,8 @@ def mock_nonblocking_socket():
sock = mock.Mock(socket.socket)
sock.gettimeout.return_value = 0.0
return sock
+
+
+def force_legacy_ssl_support():
+ return mock.patch('asyncio.sslproto._is_sslproto_available',
+ return_value=False)