(
cert: Option<&PathBuf>,
key: Option<&PathBuf>,
)
| 238 | } |
| 239 | |
| 240 | fn parse_cert_and_key( |
| 241 | cert: Option<&PathBuf>, |
| 242 | key: Option<&PathBuf>, |
| 243 | ) -> Result<(Vec<CertificateDer<'static>>, PrivateKeyDer<'static>)> { |
| 244 | let path = cert.ok_or(TlsError::MissingTlsCert)?; |
| 245 | let cert = parse_certificates(path)?; |
| 246 | |
| 247 | let path = key.ok_or(TlsError::MissingTlsKey)?; |
| 248 | let key = PrivateKeyDer::from_pem_file(path) |
| 249 | .map_err(|e| TlsError::FailedToParseTlsKey(e.to_string()))?; |
| 250 | |
| 251 | Ok((cert, key)) |
| 252 | } |
| 253 | |
| 254 | fn install_default_tls_provider() -> bool { |
| 255 | rustls::crypto::aws_lc_rs::default_provider() |
no test coverage detected