diff --git a/crates/uv-client/src/base_client.rs b/crates/uv-client/src/base_client.rs index f120917f2ac82..01f2a20c2d9ef 100644 --- a/crates/uv-client/src/base_client.rs +++ b/crates/uv-client/src/base_client.rs @@ -420,33 +420,35 @@ 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 path = Path::new(&path); - match path.metadata() { - Ok(metadata) if metadata.is_file() => true, - Ok(_) => { - warn_user_once!( - "Ignoring invalid `SSL_CERT_FILE`. Path is not a file: {}.", - path.simplified_display().cyan() - ); - false - } - Err(err) if err.kind() == std::io::ErrorKind::NotFound => { - warn_user_once!( - "Ignoring invalid `SSL_CERT_FILE`. Path does not exist: {}.", - path.simplified_display().cyan() - ); - false - } - Err(err) => { - warn_user_once!( - "Ignoring invalid `SSL_CERT_FILE`. Path is not accessible: {} ({err}).", - path.simplified_display().cyan() - ); - false + 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, + Ok(_) => { + warn_user_once!( + "Ignoring invalid `SSL_CERT_FILE`. Path is not a file: {}.", + path.simplified_display().cyan() + ); + false + } + Err(err) if err.kind() == std::io::ErrorKind::NotFound => { + warn_user_once!( + "Ignoring invalid `SSL_CERT_FILE`. Path does not exist: {}.", + path.simplified_display().cyan() + ); + false + } + Err(err) => { + warn_user_once!( + "Ignoring invalid `SSL_CERT_FILE`. Path is not accessible: {} ({err}).", + path.simplified_display().cyan() + ); + false + } } - } - }); + }); // Checks for the presence of `SSL_CERT_DIR`. // Certificate loading support is delegated to `rustls-native-certs`.