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

Method set_verify_flags

crates/stdlib/src/openssl.rs:1208–1224  ·  view source on GitHub ↗
(&self, new_flags: libc::c_ulong, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1206 }
1207 #[pygetset(setter)]
1208 fn set_verify_flags(&self, new_flags: libc::c_ulong, vm: &VirtualMachine) -> PyResult<()> {
1209 unsafe {
1210 let ctx_ptr = self.ctx().as_ptr();
1211 let param = sys::SSL_CTX_get0_param(ctx_ptr);
1212 let flags = sys::X509_VERIFY_PARAM_get_flags(param);
1213 let clear = flags & !new_flags;
1214 let set = !flags & new_flags;
1215
1216 if clear != 0 && sys::X509_VERIFY_PARAM_clear_flags(param, clear) == 0 {
1217 return Err(new_ssl_error(vm, "Failed to clear verify flags"));
1218 }
1219 if set != 0 && sys::X509_VERIFY_PARAM_set_flags(param, set) == 0 {
1220 return Err(new_ssl_error(vm, "Failed to set verify flags"));
1221 }
1222 Ok(())
1223 }
1224 }
1225 #[pygetset]
1226 fn check_hostname(&self) -> bool {
1227 self.check_hostname.load()

Callers

nothing calls this directly

Calls 4

new_ssl_errorFunction · 0.85
ErrClass · 0.50
as_ptrMethod · 0.45
ctxMethod · 0.45

Tested by

no test coverage detected