Add SSLContext.options

This commit is contained in:
Noah
2021-01-11 12:39:24 -06:00
parent 10a7f5d9af
commit a5ba2038fb

View File

@@ -345,6 +345,15 @@ impl PySslContext {
unreachable!()
}
}
#[pyproperty]
fn options(&self) -> libc::c_ulong {
self.ctx.read().options().bits()
}
#[pyproperty(setter)]
fn set_options(&self, opts: libc::c_ulong) {
self.builder()
.set_options(SslOptions::from_bits_truncate(opts));
}
#[pyproperty(setter)]
fn set_verify_mode(&self, cert: i32, vm: &VirtualMachine) -> PyResult<()> {
let mut ctx = self.builder();