Skip to content

Commit

Permalink
Expose X509_check_host
Browse files Browse the repository at this point in the history
  • Loading branch information
rushilmehra committed Jun 18, 2024
1 parent 4a63ba6 commit c8f1d42
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions boring/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down

0 comments on commit c8f1d42

Please sign in to comment.