From 0f86187781454a163839073a6f58a568c06fe3ec Mon Sep 17 00:00:00 2001 From: root <295172551@qq.com> Date: Fri, 25 Jul 2025 23:20:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83=20?= =?UTF-8?q?=E8=B7=B3=E8=BF=87=E6=89=80=E6=9C=89=E8=AF=81=E4=B9=A6=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CoreAgent.WebSocketTransport/Services/WebSocketConnection.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CoreAgent.WebSocketTransport/Services/WebSocketConnection.cs b/CoreAgent.WebSocketTransport/Services/WebSocketConnection.cs index 87c1ee3..cb00c51 100644 --- a/CoreAgent.WebSocketTransport/Services/WebSocketConnection.cs +++ b/CoreAgent.WebSocketTransport/Services/WebSocketConnection.cs @@ -45,6 +45,8 @@ public class WebSocketConnection : IWebSocketConnection } _logger.LogInformation("正在连接 WebSocket 服务器: {Uri}", uri); + // 👇 这行:跳过所有证书验证(只用于开发测试) + _webSocket.Options.RemoteCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; await _webSocket.ConnectAsync(uri, cancellationToken); _logger.LogInformation("WebSocket 连接成功"); }