For getpeercert() - returns bytes or dict depending on binary flag
(vm: &VirtualMachine, cert: &X509Ref, binary: bool)
| 348 | |
| 349 | // For getpeercert() - returns bytes or dict depending on binary flag |
| 350 | pub(crate) fn cert_to_py(vm: &VirtualMachine, cert: &X509Ref, binary: bool) -> PyResult { |
| 351 | if binary { |
| 352 | let b = cert.to_der().map_err(|e| convert_openssl_error(vm, e))?; |
| 353 | Ok(vm.ctx.new_bytes(b).into()) |
| 354 | } else { |
| 355 | cert_to_dict(vm, cert) |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | #[pyfunction] |
| 360 | pub(crate) fn _test_decode_cert(path: FsPath, vm: &VirtualMachine) -> PyResult { |
no test coverage detected