Expose X509_check_host

This commit is contained in:
Rushil Mehra 2024-06-18 16:22:07 -07:00 committed by Alessandro Ghedini
parent ac208ede66
commit 884c91e770
1 changed files with 13 additions and 0 deletions

View File

@ -592,6 +592,19 @@ impl X509Ref {
}
}
pub fn check_host(&self, host: &str) -> Result<bool, ErrorStack> {
unsafe {
cvt_n(ffi::X509_check_host(
self.as_ptr(),
host.as_ptr() as _,
host.len(),
0,
std::ptr::null_mut(),
))
.map(|n| n != 0)
}
}
to_pem! {
/// Serializes the certificate into a PEM-encoded X509 structure.
///