(path: P)
| 224 | } |
| 225 | |
| 226 | fn parse_certificates<P: AsRef<Path>>(path: P) -> Result<Vec<CertificateDer<'static>>> { |
| 227 | let path = path.as_ref(); |
| 228 | let parser = CertificateDer::pem_file_iter(path) |
| 229 | .map_err(|e| TlsError::InvalidTlsFile(path.to_path_buf(), e))? |
| 230 | .collect::<Vec<_>>(); |
| 231 | |
| 232 | let mut certs = Vec::with_capacity(parser.len()); |
| 233 | for cert in parser { |
| 234 | certs.push(cert.map_err(|e| TlsError::InvalidTlsFile(path.to_path_buf(), e))?); |
| 235 | } |
| 236 | |
| 237 | Ok(certs) |
| 238 | } |
| 239 | |
| 240 | fn parse_cert_and_key( |
| 241 | cert: Option<&PathBuf>, |
no test coverage detected