MCPcopy Index your code
hub / github.com/RustPython/RustPython / load_certs_from_dir_helper

Method load_certs_from_dir_helper

crates/stdlib/src/ssl.rs:2067–2085  ·  view source on GitHub ↗

Helper: Load certificates from directory into existing store

(
            &self,
            root_store: &mut RootCertStore,
            path: &str,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

2065
2066 /// Helper: Load certificates from directory into existing store
2067 fn load_certs_from_dir_helper(
2068 &self,
2069 root_store: &mut RootCertStore,
2070 path: &str,
2071 vm: &VirtualMachine,
2072 ) -> PyResult<cert::CertStats> {
2073 // Load certs and store them in capath_certs_der for lazy loading simulation
2074 // (CPython only returns these in get_ca_certs() after they're used in handshake)
2075 let mut capath_certs = Vec::new();
2076 let mut loader = cert::CertLoader::new(root_store, &mut capath_certs);
2077 let stats = loader
2078 .load_from_dir(path)
2079 .map_err(|e| e.into_pyexception(vm))?;
2080
2081 // Store loaded certs for potential tracking after handshake
2082 *self.capath_certs_der.write() = capath_certs;
2083
2084 Ok(stats)
2085 }
2086
2087 /// Helper: Load certificates from bytes into existing store
2088 fn load_certs_from_bytes_helper(

Callers 1

load_verify_locationsMethod · 0.80

Calls 4

newFunction · 0.85
load_from_dirMethod · 0.80
into_pyexceptionMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected