mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
bpo-29970: Make ssh_handshake_timeout None by default (#4939)
* Make ssh_handshake_timeout None by default. * Raise ValueError if ssl_handshake_timeout is used without ssl. * Raise ValueError if ssl_handshake_timeout is not positive.
This commit is contained in:
parent
a7a751dd7b
commit
51eb1c6b9c
10 changed files with 108 additions and 21 deletions
|
@ -852,6 +852,16 @@ class EventLoopTestsMixin:
|
|||
|
||||
self.test_connect_accepted_socket(server_context, client_context)
|
||||
|
||||
def test_connect_accepted_socket_ssl_timeout_for_plain_socket(self):
|
||||
sock = socket.socket()
|
||||
self.addCleanup(sock.close)
|
||||
coro = self.loop.connect_accepted_socket(
|
||||
MyProto, sock, ssl_handshake_timeout=1)
|
||||
with self.assertRaisesRegex(
|
||||
ValueError,
|
||||
'ssl_handshake_timeout is only meaningful with ssl'):
|
||||
self.loop.run_until_complete(coro)
|
||||
|
||||
@mock.patch('asyncio.base_events.socket')
|
||||
def create_server_multiple_hosts(self, family, hosts, mock_sock):
|
||||
@asyncio.coroutine
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue