aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2018-02-21 23:25:28 -0800
committerSteven Fackler <[email protected]>2018-02-21 23:25:28 -0800
commit7e0591a3776c9c919a0fc8a3effdde3cb17ce77b (patch)
treedbc9b75c14bed85b76187c14609e4f2b1c4382cd
parentMerge pull request #840 from olehermanse/master (diff)
downloadrust-openssl-7e0591a3776c9c919a0fc8a3effdde3cb17ce77b.tar.xz
rust-openssl-7e0591a3776c9c919a0fc8a3effdde3cb17ce77b.zip
Actually add version stuff
-rw-r--r--CHANGELOG.md14
-rw-r--r--openssl/src/ssl/mod.rs18
2 files changed, 25 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b716073e..0d3a5b38 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,14 @@
## [Unreleased]
+### Added
+
+* Added `SslRef::version2`.
+
+### Deprecated
+
+* `SslRef::version` has been deprecated. Use `SslRef::version_str` instead.
+
## [v0.10.4] - 2018-02-18
### Added
@@ -9,7 +17,7 @@
* Added OpenSSL 1.1.1 support.
* Added `Rsa::public_key_from_pem_pkcs1`.
* Added `SslOptions::NO_TLSV1_3`. (OpenSSL 1.1.1 only)
-* Added `SslVersion` and `SslRef::version2`.
+* Added `SslVersion`.
* Added `SslSessionCacheMode` and `SslContextBuilder::set_session_cache_mode`.
* Added `SslContextBuilder::set_new_session_callback`,
`SslContextBuilder::set_remove_session_callback`, and
@@ -22,10 +30,6 @@
* The `SslAcceptorBuilder::mozilla_modern` constructor now disables TLSv1.0 and TLSv1.1 in
accordance with Mozilla's recommendations.
-### Deprecated
-
-* `SslRef::version` has been deprecated. Use `SslRef::version_str` instead.
-
## [v0.10.3] - 2018-02-12
### Added
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 {