diff options
| author | Steven Fackler <[email protected]> | 2017-01-04 20:59:46 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2017-01-04 20:59:46 -0800 |
| commit | 88a7032f4b78895eaeeb72d3837dd698e571e882 (patch) | |
| tree | 9c2b3a9da5b0ec733d54d3530b718c84f936ef7d /openssl/src | |
| parent | Add SSL_SESSION functions (diff) | |
| download | rust-openssl-88a7032f4b78895eaeeb72d3837dd698e571e882.tar.xz rust-openssl-88a7032f4b78895eaeeb72d3837dd698e571e882.zip | |
Types and accessor for SslSession
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/ssl/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 3eead8f2..d1ed55fe 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -1334,6 +1334,11 @@ impl SslRef { pub fn verify_result(&self) -> Option<X509VerifyError> { unsafe { X509VerifyError::from_raw(ffi::SSL_get_verify_result(self.as_ptr())) } } + + /// Returns the SSL session. + pub fn session(&self) -> &SslSessionRef { + unsafe { SslSessionRef::from_ptr(ffi::SSL_get_session(self.as_ptr())) } + } } unsafe impl Sync for Ssl {} @@ -1345,6 +1350,8 @@ impl fmt::Debug for Ssl { } } +type_!(SslSession, SslSessionRef, ffi::SSL_SESSION, ffi::SSL_SESSION_free); + impl Ssl { pub fn new(ctx: &SslContext) -> Result<Ssl, ErrorStack> { unsafe { |