mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-23 17:47:31 +00:00
interface: better error msg for main server re SSL cert issues
(logger.warning is shown even without -v, if there is a terminal) closes #5884
This commit is contained in:
parent
a6dd17bfef
commit
e65ce96f9d
1 changed files with 7 additions and 1 deletions
|
@ -382,6 +382,12 @@ class Interface(Logger):
|
||||||
try:
|
try:
|
||||||
await self.open_session(ssl_context)
|
await self.open_session(ssl_context)
|
||||||
except (asyncio.CancelledError, ConnectError, aiorpcx.socks.SOCKSError) as e:
|
except (asyncio.CancelledError, ConnectError, aiorpcx.socks.SOCKSError) as e:
|
||||||
|
# make SSL errors for main interface more visible (to help servers ops debug cert pinning issues)
|
||||||
|
if (isinstance(e, ConnectError) and isinstance(e.__cause__, ssl.SSLError)
|
||||||
|
and self.is_main_server() and not self.network.auto_connect):
|
||||||
|
self.logger.warning(f'Cannot connect to main server due to SSL error '
|
||||||
|
f'(maybe cert changed compared to "{self.cert_path}"). Exc: {repr(e)}')
|
||||||
|
else:
|
||||||
self.logger.info(f'disconnecting due to: {repr(e)}')
|
self.logger.info(f'disconnecting due to: {repr(e)}')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue