diff options
| author | Steven Fackler <[email protected]> | 2018-02-21 23:25:28 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2018-02-21 23:25:28 -0800 |
| commit | 7e0591a3776c9c919a0fc8a3effdde3cb17ce77b (patch) | |
| tree | dbc9b75c14bed85b76187c14609e4f2b1c4382cd /openssl/src | |
| parent | Merge pull request #840 from olehermanse/master (diff) | |
| download | rust-openssl-7e0591a3776c9c919a0fc8a3effdde3cb17ce77b.tar.xz rust-openssl-7e0591a3776c9c919a0fc8a3effdde3cb17ce77b.zip | |
Actually add version stuff
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/ssl/mod.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 69d38f44..e4796df0 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -1957,12 +1957,26 @@ impl SslRef { } } + #[deprecated(since = "0.10.5", note = "renamed to `version_str`")] + pub fn version(&self) -> &str { + self.version_str() + } + + /// Returns the protocol version of the session. + /// + /// This corresponds to [`SSL_version`]. + /// + /// [`SSL_version`]: https://www.openssl.org/docs/manmaster/man3/SSL_version.html + pub fn version2(&self) -> SslVersion { + unsafe { SslVersion(ffi::SSL_version(self.as_ptr())) } + } + /// Returns a string describing the protocol version of the session. /// /// This corresponds to [`SSL_get_version`]. /// /// [`SSL_get_version`]: https://www.openssl.org/docs/man1.1.0/ssl/SSL_get_version.html - pub fn version(&self) -> &'static str { + pub fn version_str(&self) -> &'static str { let version = unsafe { let ptr = ffi::SSL_get_version(self.as_ptr()); CStr::from_ptr(ptr as *const _) @@ -2004,7 +2018,7 @@ impl SslRef { /// If this is greater than 0, the next call to `read` will not call down to the underlying /// stream. /// - /// This corresponds to [`SSL_pending]`. + /// This corresponds to [`SSL_pending`]. /// /// [`SSL_pending`]: https://www.openssl.org/docs/man1.1.0/ssl/SSL_pending.html pub fn pending(&self) -> usize { |