aboutsummaryrefslogtreecommitdiff
path: root/openssl/src/ssl/mod.rs
diff options
context:
space:
mode:
authorLaurence Tratt <[email protected]>2015-10-03 17:25:38 +0059
committerLaurence Tratt <[email protected]>2015-10-03 17:25:38 +0059
commitd7342a09a77088e096535205944ffc4a201b8c5d (patch)
tree1754651db9aac998f78246182713410da4ef1529 /openssl/src/ssl/mod.rs
parentMerge pull request #279 from jtdowney/sslv23_docs (diff)
downloadrust-openssl-d7342a09a77088e096535205944ffc4a201b8c5d.tar.xz
rust-openssl-d7342a09a77088e096535205944ffc4a201b8c5d.zip
Fix build on LibreSSL.
LibreSSL has deprecated SSLv3_method, so this commit makes that a compile-time feature. It also removes a test referencing SSL_OP_CISCO_ANYCONNECT, as the LibreSSL header says it is amongst "Obsolete flags kept for compatibility. No sane code should use them."
Diffstat (limited to 'openssl/src/ssl/mod.rs')
-rw-r--r--openssl/src/ssl/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs
index 360f3f3e..a68a2fc3 100644
--- a/openssl/src/ssl/mod.rs
+++ b/openssl/src/ssl/mod.rs
@@ -109,6 +109,7 @@ pub enum SslMethod {
/// Support the SSLv2, SSLv3, TLSv1, TLSv1.1, and TLSv1.2 protocols depending on what the
/// linked OpenSSL library supports.
Sslv23,
+ #[cfg(feature = "sslv3")]
/// Only support the SSLv3 protocol.
Sslv3,
/// Only support the TLSv1 protocol.
@@ -132,6 +133,7 @@ impl SslMethod {
match *self {
#[cfg(feature = "sslv2")]
SslMethod::Sslv2 => ffi::SSLv2_method(),
+ #[cfg(feature = "sslv3")]
SslMethod::Sslv3 => ffi::SSLv3_method(),
SslMethod::Tlsv1 => ffi::TLSv1_method(),
SslMethod::Sslv23 => ffi::SSLv23_method(),
@@ -150,6 +152,7 @@ impl SslMethod {
match method {
#[cfg(feature = "sslv2")]
x if x == ffi::SSLv2_method() => Some(SslMethod::Sslv2),
+ #[cfg(feature = "sslv3")]
x if x == ffi::SSLv3_method() => Some(SslMethod::Sslv3),
x if x == ffi::TLSv1_method() => Some(SslMethod::Tlsv1),
x if x == ffi::SSLv23_method() => Some(SslMethod::Sslv23),