MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / parse_certificates

Function parse_certificates

crates/cargo-lambda-remote/src/tls.rs:226–238  ·  view source on GitHub ↗
(path: P)

Source from the content-addressed store, hash-verified

224}
225
226fn 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
240fn parse_cert_and_key(
241 cert: Option<&PathBuf>,

Callers 3

server_configMethod · 0.85
client_configMethod · 0.85
parse_cert_and_keyFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected