| 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> { |