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

Method client_config

crates/cargo-lambda-remote/src/tls.rs:115–134  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

113 }
114
115 pub fn client_config(&self) -> Result<ClientConfig> {
116 CELL.get_or_init(install_default_tls_provider);
117
118 let builder = if let Some(path) = self.ca_path() {
119 let mut root_store = RootCertStore::empty();
120 root_store.add_parsable_certificates(parse_certificates(path)?);
121 ClientConfig::builder().with_root_certificates(root_store)
122 } else {
123 use rustls_platform_verifier::BuilderVerifierExt;
124 ClientConfig::builder().with_platform_verifier()
125 };
126
127 let (cert, key) = parse_cert_and_key(self.cert_path().as_ref(), self.key_path().as_ref())?;
128
129 let config = builder
130 .with_client_auth_cert(cert, key)
131 .map_err(TlsError::FailedToParseConfig)?;
132
133 Ok(config)
134 }
135
136 fn cert_path(&self) -> Option<PathBuf> {
137 self.tls_cert.clone().or_else(|| self.cached_cert_path())

Callers 3

invoke_localMethod · 0.80

Calls 5

parse_certificatesFunction · 0.85
parse_cert_and_keyFunction · 0.85
ca_pathMethod · 0.80
cert_pathMethod · 0.80
key_pathMethod · 0.80

Tested by 2