uv icon indicating copy to clipboard operation
uv copied to clipboard

Ignore `SSL_CERT_FILE` with empty value

Open taearls opened this issue 2 weeks ago • 0 comments

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:

  1. Sets SSL_CERT_FILE to an empty string
  2. 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

taearls avatar Nov 18 '25 18:11 taearls