Browse Source

测试环境 跳过所有证书验证

feature/protocol-log-Perfect
root 1 week ago
parent
commit
0f86187781
  1. 2
      CoreAgent.WebSocketTransport/Services/WebSocketConnection.cs

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

Loading…
Cancel
Save