aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/ssl
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2016-10-18 22:18:09 -0700
committerSteven Fackler <[email protected]>2016-10-18 22:21:06 -0700
commit5ab037f056174b4d69024f58fe42cf0c41a34db6 (patch)
treedb69ff63d60f1efcb9ae90124118814387520b1d /openssl/src/ssl
parentDe-enumify X509ValidationError (diff)
downloadrust-openssl-5ab037f056174b4d69024f58fe42cf0c41a34db6.tar.xz
rust-openssl-5ab037f056174b4d69024f58fe42cf0c41a34db6.zip
Allow the X509 verify error to be read from an SslRef
Diffstat (limited to 'openssl/src/ssl')
-rw-r--r--openssl/src/ssl/mod.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index fafac45c..d7adb43f 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -21,7 +21,7 @@ use ffi;
use {init, cvt, cvt_p};
use dh::DH;
-use x509::{X509StoreContext, X509FileType, X509, X509Ref};
+use x509::{X509StoreContext, X509FileType, X509, X509Ref, X509VerifyError};
#[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))]
use x509::verify::X509VerifyParamRef;
use crypto::pkey::PKey;
@@ -1007,6 +1007,13 @@ impl<'a> SslRef<'a> {
X509VerifyParamRef::from_ptr(ffi::SSL_get0_param(self.as_ptr()))
}
}
+
+ /// Returns the result of X509 certificate verification.
+ pub fn verify_result(&self) -> Option<X509VerifyError> {
+ unsafe {
+ X509VerifyError::from_raw(ffi::SSL_get_verify_result(self.0))
+ }
+ }
}
pub struct Ssl(SslRef<'static>);