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

Function parse_cert_and_key

crates/cargo-lambda-remote/src/tls.rs:240–252  ·  view source on GitHub ↗
(
    cert: Option<&PathBuf>,
    key: Option<&PathBuf>,
)

Source from the content-addressed store, hash-verified

238}
239
240fn 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
254fn install_default_tls_provider() -> bool {
255 rustls::crypto::aws_lc_rs::default_provider()

Callers 2

server_configMethod · 0.85
client_configMethod · 0.85

Calls 1

parse_certificatesFunction · 0.85

Tested by

no test coverage detected