Skip to content

Commit b48c194

Browse files
authored
feat(boring): Add set_verify_cert_store_ref method to SslContextBuilder (#45)
1 parent 7242415 commit b48c194

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

boring/src/ssl/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,19 @@ impl SslContextBuilder {
11631163
}
11641164
}
11651165

1166+
/// Sets a custom certificate store for verifying peer certificates.
1167+
#[corresponds(SSL_CTX_set1_verify_cert_store)]
1168+
pub fn set_verify_cert_store_ref(
1169+
&mut self,
1170+
cert_store: &'static X509Store,
1171+
) -> Result<(), ErrorStack> {
1172+
unsafe {
1173+
cvt(ffi::SSL_CTX_set1_verify_cert_store(self.as_ptr(), cert_store.as_ptr()) as c_int)?;
1174+
1175+
Ok(())
1176+
}
1177+
}
1178+
11661179
/// Replaces the context's certificate store.
11671180
#[corresponds(SSL_CTX_set_cert_store)]
11681181
pub fn set_cert_store(&mut self, cert_store: X509Store) {

0 commit comments

Comments
 (0)