Add SSLContext.options

This commit is contained in:
Noah committed 2021-01-11 17:32:29 -06:00
1 parent 10a7f5d9af
commit a5ba2038fb
1 file changed
+9
+9
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();