Skip to content

Commit c2ba834

Browse files
Handle Client(..., security=False) (#8980)
1 parent bd863de commit c2ba834

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

distributed/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ def __init__(
11461146
if security is None and isinstance(address, str):
11471147
security = _maybe_call_security_loader(address)
11481148

1149-
if security is None:
1149+
if security is None or security is False:
11501150
security = Security()
11511151
elif isinstance(security, dict):
11521152
security = Security(**security)

distributed/tests/test_tls_functional.py

+10
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,16 @@ async def test_security_dict_input_no_security():
209209
assert result == 2
210210

211211

212+
@gen_test()
213+
async def test_security_bool_input_disabled_security():
214+
async with Scheduler(dashboard_address=":0", security=False) as s:
215+
async with Worker(s.address, security=False):
216+
async with Client(s.address, security=False, asynchronous=True) as c:
217+
result = await c.submit(inc, 1)
218+
assert c.security.require_encryption is False
219+
assert result == 2
220+
221+
212222
@gen_test()
213223
async def test_security_dict_input():
214224
conf = tls_config()

0 commit comments

Comments
 (0)