Skip to content

Commit a05eb98

Browse files
committed
Add SSL_CTX_security_level
1 parent bb0379b commit a05eb98

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

stdlib/src/ssl.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,12 @@ mod _ssl {
633633
Ok(())
634634
}
635635

636+
#[cfg(ossl110)]
637+
#[pygetset]
638+
fn security_level(&self) -> i32 {
639+
unsafe { SSL_CTX_get_security_level(self.ctx().as_ptr()) }
640+
}
641+
636642
#[pymethod]
637643
fn set_ciphers(&self, cipherlist: PyStrRef, vm: &VirtualMachine) -> PyResult<()> {
638644
let ciphers = cipherlist.as_str();
@@ -1840,6 +1846,11 @@ mod _ssl {
18401846
fn SSL_verify_client_post_handshake(ssl: *const sys::SSL) -> libc::c_int;
18411847
}
18421848

1849+
#[cfg(ossl110)]
1850+
unsafe extern "C" {
1851+
fn SSL_CTX_get_security_level(ctx: *const sys::SSL_CTX) -> libc::c_int;
1852+
}
1853+
18431854
// OpenSSL BIO helper functions
18441855
// These are typically macros in OpenSSL, implemented via BIO_ctrl
18451856
const BIO_CTRL_PENDING: libc::c_int = 10;

0 commit comments

Comments
 (0)