Helper: Load certificates from directory into existing store
(
&self,
root_store: &mut RootCertStore,
path: &str,
vm: &VirtualMachine,
)
| 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( |
no test coverage detected