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

Method cert_store_stats

crates/stdlib/src/ssl.rs:1588–1598  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1586
1587 #[pymethod]
1588 fn cert_store_stats(&self, vm: &VirtualMachine) -> PyResult<PyObjectRef> {
1589 // Use the certificate counters that are updated in load_verify_locations
1590 let x509_count = *self.x509_cert_count.read() as i32;
1591 let ca_count = *self.ca_cert_count.read() as i32;
1592
1593 let dict = vm.ctx.new_dict();
1594 dict.set_item("x509", vm.ctx.new_int(x509_count).into(), vm)?;
1595 dict.set_item("crl", vm.ctx.new_int(0).into(), vm)?; // CRL not supported
1596 dict.set_item("x509_ca", vm.ctx.new_int(ca_count).into(), vm)?;
1597 Ok(dict.into())
1598 }
1599
1600 #[pymethod]
1601 fn session_stats(&self, vm: &VirtualMachine) -> PyResult<PyObjectRef> {

Calls 4

new_dictMethod · 0.80
readMethod · 0.45
set_itemMethod · 0.45
new_intMethod · 0.45