Skip to content

Commit 5af7831

Browse files
committed
Make http.proxy-cainfo fallback to http.cainfo, like curl.
1 parent ca4a3b1 commit 5af7831

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/cargo/util/network/http.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ pub fn configure_http_handle(gctx: &GlobalContext, handle: &mut Easy) -> CargoRe
6161
let cainfo = cainfo.resolve_path(gctx);
6262
handle.cainfo(&cainfo)?;
6363
}
64-
if let Some(proxy_cainfo) = &http.proxy_cainfo {
64+
// Use `proxy_cainfo` if explicitly set; otherwise, fall back to `cainfo` as curl does #15376.
65+
if let Some(proxy_cainfo) = http.proxy_cainfo.as_ref().or(http.cainfo.as_ref()) {
6566
let proxy_cainfo = proxy_cainfo.resolve_path(gctx);
6667
handle.proxy_cainfo(&format!("{}", proxy_cainfo.display()))?;
6768
}

src/doc/src/reference/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ certificates. If not specified, Cargo attempts to use the system certificates.
711711

712712
#### `http.proxy-cainfo`
713713
* Type: string (path)
714-
* Default: none
714+
* Default: falls back to `http.cainfo` if not set
715715
* Environment: `CARGO_HTTP_PROXY_CAINFO`
716716

717717
Path to a Certificate Authority (CA) bundle file, used to verify proxy TLS

0 commit comments

Comments
 (0)