feat(boring): Add set_verify_cert_store_ref method to SslContextBuilder (#45)

This commit is contained in:
0x676e67 2025-02-07 13:45:24 +08:00 committed by GitHub
parent 72424152a9
commit b48c194d16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -1163,6 +1163,19 @@ impl SslContextBuilder {
} }
} }
/// Sets a custom certificate store for verifying peer certificates.
#[corresponds(SSL_CTX_set1_verify_cert_store)]
pub fn set_verify_cert_store_ref(
&mut self,
cert_store: &'static X509Store,
) -> Result<(), ErrorStack> {
unsafe {
cvt(ffi::SSL_CTX_set1_verify_cert_store(self.as_ptr(), cert_store.as_ptr()) as c_int)?;
Ok(())
}
}
/// Replaces the context's certificate store. /// Replaces the context's certificate store.
#[corresponds(SSL_CTX_set_cert_store)] #[corresponds(SSL_CTX_set_cert_store)]
pub fn set_cert_store(&mut self, cert_store: X509Store) { pub fn set_cert_store(&mut self, cert_store: X509Store) {