Merge pull request #280 from ltratt/libressl_build
Fix build on LibreSSL.
This commit is contained in:
commit
aad933e507
|
|
@ -17,6 +17,7 @@ tlsv1_1 = []
|
||||||
dtlsv1 = []
|
dtlsv1 = []
|
||||||
dtlsv1_2 = []
|
dtlsv1_2 = []
|
||||||
sslv2 = []
|
sslv2 = []
|
||||||
|
sslv3 = []
|
||||||
aes_xts = []
|
aes_xts = []
|
||||||
aes_ctr = []
|
aes_ctr = []
|
||||||
npn = []
|
npn = []
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ pub enum SslMethod {
|
||||||
/// Support the SSLv2, SSLv3, TLSv1, TLSv1.1, and TLSv1.2 protocols depending on what the
|
/// Support the SSLv2, SSLv3, TLSv1, TLSv1.1, and TLSv1.2 protocols depending on what the
|
||||||
/// linked OpenSSL library supports.
|
/// linked OpenSSL library supports.
|
||||||
Sslv23,
|
Sslv23,
|
||||||
|
#[cfg(feature = "sslv3")]
|
||||||
/// Only support the SSLv3 protocol.
|
/// Only support the SSLv3 protocol.
|
||||||
Sslv3,
|
Sslv3,
|
||||||
/// Only support the TLSv1 protocol.
|
/// Only support the TLSv1 protocol.
|
||||||
|
|
@ -132,6 +133,7 @@ impl SslMethod {
|
||||||
match *self {
|
match *self {
|
||||||
#[cfg(feature = "sslv2")]
|
#[cfg(feature = "sslv2")]
|
||||||
SslMethod::Sslv2 => ffi::SSLv2_method(),
|
SslMethod::Sslv2 => ffi::SSLv2_method(),
|
||||||
|
#[cfg(feature = "sslv3")]
|
||||||
SslMethod::Sslv3 => ffi::SSLv3_method(),
|
SslMethod::Sslv3 => ffi::SSLv3_method(),
|
||||||
SslMethod::Tlsv1 => ffi::TLSv1_method(),
|
SslMethod::Tlsv1 => ffi::TLSv1_method(),
|
||||||
SslMethod::Sslv23 => ffi::SSLv23_method(),
|
SslMethod::Sslv23 => ffi::SSLv23_method(),
|
||||||
|
|
@ -150,6 +152,7 @@ impl SslMethod {
|
||||||
match method {
|
match method {
|
||||||
#[cfg(feature = "sslv2")]
|
#[cfg(feature = "sslv2")]
|
||||||
x if x == ffi::SSLv2_method() => Some(SslMethod::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::SSLv3_method() => Some(SslMethod::Sslv3),
|
||||||
x if x == ffi::TLSv1_method() => Some(SslMethod::Tlsv1),
|
x if x == ffi::TLSv1_method() => Some(SslMethod::Tlsv1),
|
||||||
x if x == ffi::SSLv23_method() => Some(SslMethod::Sslv23),
|
x if x == ffi::SSLv23_method() => Some(SslMethod::Sslv23),
|
||||||
|
|
|
||||||
|
|
@ -416,10 +416,6 @@ run_test!(set_ctx_options, |method, _| {
|
||||||
let mut ctx = SslContext::new(method).unwrap();
|
let mut ctx = SslContext::new(method).unwrap();
|
||||||
let opts = ctx.set_options(ssl::SSL_OP_NO_TICKET);
|
let opts = ctx.set_options(ssl::SSL_OP_NO_TICKET);
|
||||||
assert!(opts.contains(ssl::SSL_OP_NO_TICKET));
|
assert!(opts.contains(ssl::SSL_OP_NO_TICKET));
|
||||||
assert!(!opts.contains(ssl::SSL_OP_CISCO_ANYCONNECT));
|
|
||||||
let more_opts = ctx.set_options(ssl::SSL_OP_CISCO_ANYCONNECT);
|
|
||||||
assert!(more_opts.contains(ssl::SSL_OP_NO_TICKET));
|
|
||||||
assert!(more_opts.contains(ssl::SSL_OP_CISCO_ANYCONNECT));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
run_test!(clear_ctx_options, |method, _| {
|
run_test!(clear_ctx_options, |method, _| {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue