diff options
| author | Steven Fackler <[email protected]> | 2014-09-25 02:43:36 -0400 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2014-09-25 02:43:36 -0400 |
| commit | fa53c79e4892dfc260bc6d1e2b52892f5607de72 (patch) | |
| tree | d099a2732f2702423220b686b2cc010386da4f62 /src/ssl/mod.rs | |
| parent | Merge pull request #51 from ebfe/deprecated (diff) | |
| parent | TLS 1_1, 1_2, Ssl 2 is enabled by features (diff) | |
| download | rust-openssl-fa53c79e4892dfc260bc6d1e2b52892f5607de72.tar.xz rust-openssl-fa53c79e4892dfc260bc6d1e2b52892f5607de72.zip | |
Merge pull request #46 from vhbit/tls1-2-support
Enabling TLS1.2 support
Diffstat (limited to 'src/ssl/mod.rs')
| -rw-r--r-- | src/ssl/mod.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/ssl/mod.rs b/src/ssl/mod.rs index 785b8dfc..fc775a32 100644 --- a/src/ssl/mod.rs +++ b/src/ssl/mod.rs @@ -48,8 +48,9 @@ fn init() { /// Determines the SSL method supported #[deriving(Show, Hash, PartialEq, Eq)] +#[allow(non_camel_case_types)] pub enum SslMethod { - #[cfg(sslv2)] + #[cfg(feature = "sslv2")] /// Only support the SSLv2 protocol Sslv2, /// Only support the SSLv3 protocol @@ -58,16 +59,24 @@ pub enum SslMethod { Tlsv1, /// Support the SSLv2, SSLv3 and TLSv1 protocols Sslv23, + #[cfg(feature = "tlsv1_1")] + Tlsv1_1, + #[cfg(feature = "tlsv1_2")] + Tlsv1_2, } impl SslMethod { unsafe fn to_raw(&self) -> *const ffi::SSL_METHOD { match *self { - #[cfg(sslv2)] + #[cfg(feature = "sslv2")] Sslv2 => ffi::SSLv2_method(), Sslv3 => ffi::SSLv3_method(), Tlsv1 => ffi::TLSv1_method(), - Sslv23 => ffi::SSLv23_method() + Sslv23 => ffi::SSLv23_method(), + #[cfg(feature = "tlsv1_1")] + Tlsv1_1 => ffi::TLSv1_1_method(), + #[cfg(feature = "tlsv1_2")] + Tlsv1_2 => ffi::TLSv1_2_method() } } } |