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 { + // 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 { + // 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 {