From a3c1ab8f721d8ea2cbd26e700cd89a33da12fd2e Mon Sep 17 00:00:00 2001 From: 1cbyc Date: Thu, 12 Mar 2026 17:11:57 +0000 Subject: [PATCH] fix: ignore empty SSL_CERT_FILE environment variable Apply the same filtering logic used for other environment variables (e.g., NO_COLOR, FORCE_COLOR) to SSL_CERT_FILE. Empty values should be ignored rather than treated as valid paths. This aligns with the behavior of other environment variable handling in the codebase and prevents issues when SSL_CERT_FILE is set to an empty string. Fixes #16712 --- crates/uv-client/src/base_client.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/uv-client/src/base_client.rs b/crates/uv-client/src/base_client.rs index 399525cbd58be..3de465def2f6b 100644 --- a/crates/uv-client/src/base_client.rs +++ b/crates/uv-client/src/base_client.rs @@ -480,7 +480,9 @@ impl<'a> BaseClientBuilder<'a> { // Checks for the presence of `SSL_CERT_FILE`. // Certificate loading support is delegated to `rustls-native-certs`. // See https://github.com/rustls/rustls-native-certs/blob/813790a297ad4399efe70a8e5264ca1b420acbec/src/lib.rs#L118-L125 - let ssl_cert_file_exists = env::var_os(EnvVars::SSL_CERT_FILE).is_some_and(|path| { + let ssl_cert_file_exists = env::var_os(EnvVars::SSL_CERT_FILE) + .filter(|v| !v.is_empty()) + .is_some_and(|path| { let path = Path::new(&path); match path.metadata() { Ok(metadata) if metadata.is_file() => true,