Skip to content

Commit

Permalink
Revert "feat: add error message for failed SSL handshakes"
Browse files Browse the repository at this point in the history
This reverts commit fc93b67.
  • Loading branch information
thegamecracks committed Mar 24, 2024
1 parent 09f50a9 commit 2497292
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/dumdum/client/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import logging
import queue
import ssl
import traceback
from tkinter import Event, Tk, messagebox
from tkinter.ttk import Frame
from typing import Any, Awaitable, ContextManager, Protocol, runtime_checkable
Expand All @@ -26,15 +25,6 @@
log = logging.getLogger(__name__)


def reset_during_ssl_handshake(exc: ConnectionResetError) -> bool:
for stack in traceback.extract_tb(exc.__traceback__):
if "handshake" in stack.name:
return True
if stack.line is not None and "handshake" in stack.line:
return True
return False


class ClientStoreFactory(Protocol):
def __call__(self) -> ContextManager[ClientStore]: ...

Expand Down Expand Up @@ -200,13 +190,6 @@ def _on_connection_lost(self, event: Event) -> None:
"The server is unable to use SSL encryption. If you still want to "
"connect using an insecure connection, you must turn off SSL.",
)
elif isinstance(exc, ConnectionResetError) and reset_during_ssl_handshake(exc):
log.error("Lost connection during SSL handshake", exc_info=exc)
messagebox.showerror(
"Connection Lost",
"The server closed our connection during the SSL handshake. "
"Maybe the server does not use SSL?",
)
elif isinstance(exc, BaseExceptionGroup) and len(exc.exceptions) == 1:
first_exception = exc.exceptions[0]
log.error("Lost connection with server", exc_info=exc)
Expand Down

0 comments on commit 2497292

Please sign in to comment.