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 连接成功"); }