Skip to content

Commit 7d59690

Browse files
committed
Introduce Ssl::set_certificate
1 parent f837aeb commit 7d59690

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

boring/src/ssl/mod.rs

+13
Original file line numberDiff line numberDiff line change
@@ -3258,6 +3258,19 @@ impl SslRef {
32583258
pub fn set_mtu(&mut self, mtu: u32) -> Result<(), ErrorStack> {
32593259
unsafe { cvt(ffi::SSL_set_mtu(self.as_ptr(), mtu as c_uint) as c_int).map(|_| ()) }
32603260
}
3261+
3262+
/// Sets the certificate.
3263+
///
3264+
/// This corresponds to [`SSL_use_certificate`].
3265+
///
3266+
/// [`SSL_use_certificate`]: https://www.openssl.org/docs/manmaster/man3/SSL_do_handshake.html
3267+
pub fn set_certificate(&mut self, cert: &X509Ref) -> Result<(), ErrorStack> {
3268+
unsafe {
3269+
cvt(ffi::SSL_use_certificate(self.as_ptr(), cert.as_ptr()))?;
3270+
}
3271+
3272+
Ok(())
3273+
}
32613274
}
32623275

32633276
/// An SSL stream midway through the handshake process.

0 commit comments

Comments
 (0)