Skip to content

Commit

Permalink
log ssl error only once per socket
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jul 2, 2024
1 parent 0372464 commit a9f422e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions xpra/server/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1348,13 +1348,14 @@ def _ssl_wrap_socket(self, socktype: str, sock, socket_options):
ssllog("SSL error", exc_info=True)
ssl_paths = [socket_options.get(x, kwargs.get(x)) for x in ("ssl-cert", "ssl-key")]
cpaths = csv(f"{x!r}" for x in ssl_paths if x)
log.error("Error: failed to create SSL socket")
log.error(" from %s socket: %s", socktype, sock)
log_fn = log.error if first_time(f"ssl-wrap-{socktype}-{socket_options}") else log.debug
log_fn("Error: failed to create SSL socket")
log_fn(" from %s socket: %s", socktype, sock)
if not cpaths:
log.error(" no certificate paths specified")
log_fn(" no certificate paths specified")
else:
log.error(" check your certificate paths: %s", cpaths)
log.estr(e)
log_fn(" check your certificate paths: %s", cpaths)
log_fn(" %s", e)
noerr(sock.close)
return None

Expand Down

0 comments on commit a9f422e

Please sign in to comment.