Open
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