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(core): pin etcd metrics and consul clients to rustls

xiangwenhai065da1a829ec
diff --git a/crates/dbx-core/src/agent_kv.rs b/crates/dbx-core/src/agent_kv.rs
index 8251e075f4..df04f858a4 100644
--- a/crates/dbx-core/src/agent_kv.rs
+++ b/crates/dbx-core/src/agent_kv.rs
@@ -1224,7 +1224,12 @@ async fn build_etcd_metrics_client_with_identity(
options: &EtcdMetricsConnectionOptions,
include_identity: bool,
) -> Result<reqwest::Client, String> {
+ // The desktop binary pulls in reqwest's default `default-tls` feature, which unifies with
+ // this crate's `rustls-tls` and makes `Client::builder()` silently select native-tls.
+ // native-tls rejects the PEM client identity built below with `incompatible TLS identity
+ // type`, so an mTLS etcd would lose its client certificate and fail the handshake.
let mut builder = reqwest::Client::builder()
+ .use_rustls_tls()
.connect_timeout(ETCD_METRICS_TIMEOUT)
.timeout(ETCD_METRICS_TIMEOUT)
.redirect(reqwest::redirect::Policy::none());
diff --git a/crates/dbx-core/src/consul/client.rs b/crates/dbx-core/src/consul/client.rs
index e3d212c235..929d1261fb 100644
--- a/crates/dbx-core/src/consul/client.rs
+++ b/crates/dbx-core/src/consul/client.rs
@@ -19,7 +19,12 @@ pub struct ConsulClient {
impl ConsulClient {
pub async fn new(mut config: ConsulConfig) -> Result<Self, String> {
+ // The desktop build unifies reqwest with both `default-tls` and `rustls-tls`,
+ // and `TlsBackend` defaults to native-tls there, which rejects the PEM identity
+ // below with `incompatible TLS identity type`. Pin rustls like the etcd metrics
+ // client so mTLS Consul works in every target.
let mut builder = reqwest::Client::builder()
+ .use_rustls_tls()
.connect_timeout(Duration::from_secs(config.connect_timeout_secs.max(1)))
.redirect(reqwest::redirect::Policy::none());
if config.request_timeout_secs > 0 {