| 292 | /// * `client_certificate` - Path to the client's public certificate associated with the private key |
| 293 | #[cfg(not(any(target_os = "macos", target_os = "windows", target_os = "ios")))] |
| 294 | pub fn try_new_https_mutual<CA, K, D>( |
| 295 | base_path: &str, |
| 296 | ca_certificate: CA, |
| 297 | client_key: K, |
| 298 | client_certificate: D, |
| 299 | ) -> Result<Self, ClientInitError> |
| 300 | where |
| 301 | CA: AsRef<Path>, |
| 302 | K: AsRef<Path>, |
| 303 | D: AsRef<Path>, |
| 304 | { |
| 305 | let https_connector = Connector::builder() |
| 306 | .https() |
| 307 | .pin_server_certificate(ca_certificate) |
| 308 | .client_authentication(client_key, client_certificate) |
| 309 | .build() |
| 310 | .map_err(ClientInitError::SslError)?; |
| 311 | Self::try_new_with_connector(base_path, Some("https"), https_connector) |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | impl<S, C> Client<S, C> |