fix(copilot): add verify=False for HTTPS with self-signed certs

Add verify=False to requests.get() when capture_url uses HTTPS protocol,
to skip SSL certificate validation. This allows PacketCaptureTool to
work with GNS3 servers using self-signed certificates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
YueGuobin 2026-04-23 23:20:41 +08:00
parent f06b5fff21
commit d6d4f7262e
No known key found for this signature in database

View File

@ -185,11 +185,14 @@ class PacketCaptureTool(BaseTool):
import requests
headers = {"Authorization": f"Bearer {jwt_token}"}
# Use verify=False for HTTPS to skip certificate validation (for self-signed certs)
verify_cert = not capture_url.startswith("https://")
response = requests.get(
capture_url,
headers=headers,
stream=True,
timeout=30,
verify=verify_cert,
)
if response.status_code != 200: