-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
A-networkingArea: networking issues, curl, etc.Area: networking issues, curl, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.Status: Needs more info, such as a reproduction or more background for a feature request.
Description
Problem
While spinning up development images that don't have our enterprise CA included we get the following error on any cargo command that needs to contact the crates-io registry
Caused by:
download of config.json failed
Caused by:
[60] SSL peer certificate or SSH remote key was not OK (SSL certificate problem: unable to get local issuer certificate)
Normally you can bypass this by adding insecure to the cURL config file or by setting an environmental variable but the Easy library of cURL limits the environmental variables to a very limited set which SSL_VERIFY_PEER
is not one of.
Would it be possible to be able to set the ssl_verify_peer
option as well through the Cargo.toml
config?
Proposed Solution
- An option in the config with verify_peer set to true as default
pub struct CargoHttpConfig {
...
pub no_verify_peer: Option<bool>,
...
}
- Add code the the handle
pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult<HttpTimeout> {
...
if let Some(no_verify_peer) = http.no_verify_peer {
handle.ssl_verify_peer(!no_verify_peer)?;
}
...
Notes
No response
koxu1996
Metadata
Metadata
Assignees
Labels
A-networkingArea: networking issues, curl, etc.Area: networking issues, curl, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.Status: Needs more info, such as a reproduction or more background for a feature request.