feat: Add `set_options` binding function to ConnectConfiguration (#43)
This commit is contained in:
parent
c6e390a8b8
commit
32492cd4f0
|
|
@ -314,6 +314,24 @@ impl ConnectConfiguration {
|
||||||
pub fn set_alps_use_new_codepoint(&mut self, use_new: bool) {
|
pub fn set_alps_use_new_codepoint(&mut self, use_new: bool) {
|
||||||
unsafe { ffi::SSL_set_alps_use_new_codepoint(self.as_ptr(), use_new as _) }
|
unsafe { ffi::SSL_set_alps_use_new_codepoint(self.as_ptr(), use_new as _) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the SSL options.
|
||||||
|
///
|
||||||
|
/// # Arguments
|
||||||
|
///
|
||||||
|
/// * `options` - An `SslOptions` bitmask representing the options to set.
|
||||||
|
///
|
||||||
|
/// # Returns
|
||||||
|
///
|
||||||
|
/// * `Result<(), ErrorStack>` - Returns `Ok(())` if the operation is successful, otherwise returns an `ErrorStack`.
|
||||||
|
///
|
||||||
|
/// # Safety
|
||||||
|
///
|
||||||
|
/// This function is unsafe because it calls an FFI function.
|
||||||
|
#[corresponds(SSL_set_options)]
|
||||||
|
pub fn set_options(&mut self, options: SslOptions) -> Result<(), ErrorStack> {
|
||||||
|
unsafe { cvt(ffi::SSL_set_options(self.as_ptr(), options.bits()) as _).map(|_| ()) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Deref for ConnectConfiguration {
|
impl Deref for ConnectConfiguration {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue