diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index 5233572f130..458f6763c70 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -558,6 +558,18 @@ pub fn configure_http_handle(config: &Config, handle: &mut Easy) -> CargoResult< if let Some(proxy) = http_proxy(config)? { handle.proxy(&proxy)?; } + if let Some(client_ssl_cert) = &http.client_ssl_cert { + let client_ssl_cert = client_ssl_cert.resolve_path(config); + handle.ssl_cert(&client_ssl_cert)?; + handle.ssl_cert_type("PEM")?; + } + if let Some(client_ssl_key) = &http.client_ssl_key { + let client_ssl_key = client_ssl_key.resolve_path(config); + handle.ssl_key(&client_ssl_key)?; + } + if let Some(client_ssl_key_password) = &http.client_ssl_key_password { + handle.key_password(client_ssl_key_password.as_str())?; + } if let Some(cainfo) = &http.cainfo { let cainfo = cainfo.resolve_path(config); handle.cainfo(&cainfo)?; diff --git a/src/cargo/util/config/mod.rs b/src/cargo/util/config/mod.rs index e20004c0dcc..5a3cd9f1898 100644 --- a/src/cargo/util/config/mod.rs +++ b/src/cargo/util/config/mod.rs @@ -2117,6 +2117,9 @@ pub struct CargoHttpConfig { pub debug: Option, pub multiplexing: Option, pub ssl_version: Option, + pub client_ssl_cert: Option, + pub client_ssl_key: Option, + pub client_ssl_key_password: Option, } #[derive(Debug, Default, Deserialize, PartialEq)]