From b18c63f8bd6ca6b2cac4b6bee41dd8fbe4da213b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Wed, 20 May 2026 23:12:25 +0300 Subject: [PATCH] fix: SSL skip verify on Windows, fix Mac Cmd+V paste SSL: always unverified on win32/frozen (missing root certs). Paste: bind Command+Control+Meta modifiers for all Tk versions. Co-Authored-By: Claude Opus 4.6 --- ssh_manager.py | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/ssh_manager.py b/ssh_manager.py index 821d8e3..077ec43 100644 --- a/ssh_manager.py +++ b/ssh_manager.py @@ -493,7 +493,6 @@ def agent_search(query): def setup_entry_clipboard(entry): """Add clipboard support (Ctrl/Cmd+C/V/X/A) and right-click menu to tk.Entry.""" - mod = "Command" if sys.platform == "darwin" else "Control" def _paste(e=None): try: @@ -532,14 +531,17 @@ def setup_entry_clipboard(entry): menu.add_command(label="Выделить всё", command=_select_all) menu.tk_popup(event.x_root, event.y_root) - entry.bind(f"<{mod}-v>", _paste) - entry.bind(f"<{mod}-V>", _paste) - entry.bind(f"<{mod}-c>", _copy) - entry.bind(f"<{mod}-C>", _copy) - entry.bind(f"<{mod}-x>", _cut) - entry.bind(f"<{mod}-X>", _cut) - entry.bind(f"<{mod}-a>", _select_all) - entry.bind(f"<{mod}-A>", _select_all) + # Bind all possible modifier combos for macOS and Windows + for mod in ("Command", "Control", "Meta"): + for key, func in [("v", _paste), ("V", _paste), + ("c", _copy), ("C", _copy), + ("x", _cut), ("X", _cut), + ("a", _select_all), ("A", _select_all)]: + try: + entry.bind(f"<{mod}-{key}>", func) + except tk.TclError: + pass + entry.bind("", _context_menu) if sys.platform == "darwin": entry.bind("", _context_menu) @@ -1019,19 +1021,13 @@ class AISettingsDialog(tk.Toplevel): # ── AI API Caller ───────────────────────────────────────────── def _ssl_context(): - """Create SSL context that works on Windows without certifi.""" - try: + """Create SSL context — skip verify on Windows/frozen (often missing certs).""" + if sys.platform == "win32" or getattr(sys, "frozen", False): ctx = ssl.create_default_context() - # Test if default certs work - ctx.check_hostname = True + ctx.check_hostname = False + ctx.verify_mode = ssl.CERT_NONE return ctx - except Exception: - pass - # Fallback: unverified context (Windows without certs) - ctx = ssl.create_default_context() - ctx.check_hostname = False - ctx.verify_mode = ssl.CERT_NONE - return ctx + return None # use default on macOS/Linux def call_claude_api(api_key, query):