Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(cli): install default rustls crypto provider to prevent panic

Mae Morella694c34427818
diff --git a/Cargo.lock b/Cargo.lock
index b11ce95883..55b7bac5ce 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2063,6 +2063,7 @@ dependencies = [
"async-trait",
"dbx-core",
"dbx-mcp",
+ "rustls 0.23.43",
"serde",
"serde_json",
"tempfile",
diff --git a/crates/dbx-cli/Cargo.toml b/crates/dbx-cli/Cargo.toml
index c100e4b0ac..50064e98d3 100644
--- a/crates/dbx-cli/Cargo.toml
+++ b/crates/dbx-cli/Cargo.toml
@@ -11,6 +11,7 @@ path = "src/main.rs"
[dependencies]
dbx-core = { path = "../dbx-core", default-features = false, features = ["sqlite-bundled"] }
dbx-mcp = { path = "../dbx-mcp" }
+rustls = { version = "0.23", features = ["aws-lc-rs"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["fs", "macros", "rt-multi-thread"] }
diff --git a/crates/dbx-cli/src/main.rs b/crates/dbx-cli/src/main.rs
index 540589a245..e42eaea097 100644
--- a/crates/dbx-cli/src/main.rs
+++ b/crates/dbx-cli/src/main.rs
@@ -178,6 +178,9 @@ async fn main() -> ExitCode {
}
async fn run(argv: Vec<String>) -> Result<String, (CliError, bool)> {
+ // Set aws_lc_rs as the process-level default CryptoProvider to prevent a rustls panic
+ let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
+
let wants_json = argv.iter().any(|arg| arg == "--json");
let flags = parse_flags(&argv).map_err(|error| (error, wants_json))?;
let json_output = flags.format == OutputFormat::Json;