Skip to content

Commit 07fe11d

Browse files
Add more useful exception message on TLS cert mismatch (#5040)
1 parent 8dbb8df commit 07fe11d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

distributed/comm/tcp.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import struct
66
import sys
77
import weakref
8-
from ssl import SSLError
8+
from ssl import SSLCertVerificationError, SSLError
99

1010
from tornado import gen
1111

@@ -386,6 +386,11 @@ async def connect(self, address, deserialize=True, **connection_args):
386386
except StreamClosedError as e:
387387
# The socket connect() call failed
388388
convert_stream_closed_error(self, e)
389+
except SSLCertVerificationError as err:
390+
raise FatalCommClosedError(
391+
"TLS certificate does not match. Check your security settings. "
392+
"More info at https://distributed.dask.org/en/latest/tls.html"
393+
) from err
389394
except SSLError as err:
390395
raise FatalCommClosedError() from err
391396

0 commit comments

Comments
 (0)