MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / read_system_ca_bundle

Function read_system_ca_bundle

crates/openshell-supervisor-network/src/l7/tls.rs:293–304  ·  view source on GitHub ↗

Read the system CA bundle from well-known paths. Returns the PEM contents of the first non-empty bundle found, or an empty string if none of the well-known paths exist. Call once and pass the result to both [`write_ca_files`] and [`build_upstream_client_config`].

()

Source from the content-addressed store, hash-verified

291/// string if none of the well-known paths exist. Call once and pass the result
292/// to both [`write_ca_files`] and [`build_upstream_client_config`].
293pub fn read_system_ca_bundle() -> String {
294 for path in SYSTEM_CA_PATHS {
295 if let Ok(contents) = std::fs::read_to_string(path)
296 && !contents.is_empty()
297 {
298 return contents;
299 }
300 }
301 // No system bundle found — combined file will contain only the sandbox CA.
302 // This is acceptable since the proxy uses webpki-roots independently.
303 String::new()
304}
305
306/// Parse PEM certificates from a file into DER-encoded certificates.
307pub fn parse_pem_certs(path: &Path) -> Result<Vec<CertificateDer<'static>>> {

Callers 1

run_networkingFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected