From a5ba2038fb5051a0c745ea6fcf5c045a6249ffc5 Mon Sep 17 00:00:00 2001 From: Noah <33094578+coolreader18@users.noreply.github.com> Date: Mon, 11 Jan 2021 12:39:24 -0600 Subject: [PATCH] Add SSLContext.options --- vm/src/stdlib/ssl.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vm/src/stdlib/ssl.rs b/vm/src/stdlib/ssl.rs index c17259f66..1c3f3f3cd 100644 --- a/vm/src/stdlib/ssl.rs +++ b/vm/src/stdlib/ssl.rs @@ -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();