Skip to content

Commit a5ba203

Browse files
committed
Add SSLContext.options
1 parent 10a7f5d commit a5ba203

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

vm/src/stdlib/ssl.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,15 @@ impl PySslContext {
345345
unreachable!()
346346
}
347347
}
348+
#[pyproperty]
349+
fn options(&self) -> libc::c_ulong {
350+
self.ctx.read().options().bits()
351+
}
352+
#[pyproperty(setter)]
353+
fn set_options(&self, opts: libc::c_ulong) {
354+
self.builder()
355+
.set_options(SslOptions::from_bits_truncate(opts));
356+
}
348357
#[pyproperty(setter)]
349358
fn set_verify_mode(&self, cert: i32, vm: &VirtualMachine) -> PyResult<()> {
350359
let mut ctx = self.builder();

0 commit comments

Comments
 (0)