uv
uv copied to clipboard
Ignore `SSL_CERT_FILE` with empty value
Summary
Fixes #16712.
This PR adds empty value filtering to SSL_CERT_FILE environment variable handling, matching the existing behavior of SSL_CERT_DIR.
Previously, setting SSL_CERT_FILE="" would cause uv to attempt to use an empty string as a file path, resulting in a "file does not exist" warning. With this change, an empty SSL_CERT_FILE is treated as unset, falling back to default certificate handling.
The fix adds .filter(|v| !v.is_empty()) to the SSL_CERT_FILE processing in crates/uv-client/src/base_client.rs, consistent with the pattern used for SSL_CERT_DIR and other environment variables like NO_COLOR and FORCE_COLOR.
Test Plan
Added a test case to crates/uv-client/tests/it/ssl_certs.rs that:
- Sets
SSL_CERT_FILEto an empty string - Verifies the connection fails with
UnknownCA(indicating default certificate handling was used, not a path-related error)
Run the test with:
cargo test --package uv-client --test it -- ssl_env_vars --exact