diff --git a/distributed/client.py b/distributed/client.py index ecf459082d3..fd147b9d9d4 100644 --- a/distributed/client.py +++ b/distributed/client.py @@ -1146,7 +1146,7 @@ def __init__( if security is None and isinstance(address, str): security = _maybe_call_security_loader(address) - if security is None: + if security is None or security is False: security = Security() elif isinstance(security, dict): security = Security(**security) diff --git a/distributed/tests/test_tls_functional.py b/distributed/tests/test_tls_functional.py index bbddc550e07..1f5e83bc580 100644 --- a/distributed/tests/test_tls_functional.py +++ b/distributed/tests/test_tls_functional.py @@ -209,6 +209,16 @@ async def test_security_dict_input_no_security(): assert result == 2 +@gen_test() +async def test_security_bool_input_disabled_security(): + async with Scheduler(dashboard_address=":0", security=False) as s: + async with Worker(s.address, security=False): + async with Client(s.address, security=False, asynchronous=True) as c: + result = await c.submit(inc, 1) + assert c.security.require_encryption is False + assert result == 2 + + @gen_test() async def test_security_dict_input(): conf = tls_config()