From fd6868efcee77d9edb8a4076a1751fb5da93cfcf Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Thu, 23 Apr 2026 22:52:51 +0800 Subject: [PATCH] fix(web-wireshark): add -k flag to curl for HTTPS with self-signed certs Add -k flag to curl command when capture_stream_url uses HTTPS protocol, to skip SSL certificate validation. This allows Web Wireshark to work with GNS3 servers using self-signed certificates. Co-Authored-By: Claude Opus 4.6 --- gns3server/agent/web_wireshark/manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gns3server/agent/web_wireshark/manager.py b/gns3server/agent/web_wireshark/manager.py index 8fedb8f22..19d23a5ab 100644 --- a/gns3server/agent/web_wireshark/manager.py +++ b/gns3server/agent/web_wireshark/manager.py @@ -888,8 +888,10 @@ class WebWiresharkManager: raise RuntimeError("Container has no IP address") # Start Wireshark in background (fire-and-forget, no waiting) + # Use -k for HTTPS to skip certificate validation (for self-signed certs) + curl_insecure_flag = "-k" if capture_stream_url.startswith("https://") else "" wireshark_cmd = ( - f"curl -N -H 'Authorization: Bearer {jwt_token}' " + f"curl {curl_insecure_flag} -N -H 'Authorization: Bearer {jwt_token}' " f"'{capture_stream_url}' | " f"wireshark -i - -k --fullscreen -display :{display} &" )