mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -327,6 +327,14 @@ class SelectorEventLoopUnixSocketTests(test_utils.TestCase):
|
|||
finally:
|
||||
os.unlink(fn)
|
||||
|
||||
def test_create_unix_server_ssl_timeout_with_plain_sock(self):
|
||||
coro = self.loop.create_unix_server(lambda: None, path='spam',
|
||||
ssl_handshake_timeout=1)
|
||||
with self.assertRaisesRegex(
|
||||
ValueError,
|
||||
'ssl_handshake_timeout is only meaningful with ssl'):
|
||||
self.loop.run_until_complete(coro)
|
||||
|
||||
def test_create_unix_connection_path_inetsock(self):
|
||||
sock = socket.socket()
|
||||
with sock:
|
||||
|
@ -383,6 +391,15 @@ class SelectorEventLoopUnixSocketTests(test_utils.TestCase):
|
|||
|
||||
self.loop.run_until_complete(coro)
|
||||
|
||||
def test_create_unix_connection_ssl_timeout_with_plain_sock(self):
|
||||
coro = self.loop.create_unix_connection(lambda: None, path='spam',
|
||||
ssl_handshake_timeout=1)
|
||||
with self.assertRaisesRegex(
|
||||
ValueError,
|
||||
'ssl_handshake_timeout is only meaningful with ssl'):
|
||||
self.loop.run_until_complete(coro)
|
||||
|
||||
|
||||
|
||||
class UnixReadPipeTransportTests(test_utils.TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue