Loading ssl/ffi.rs +2 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,8 @@ extern "C" { pub fn SSL_library_init() -> c_int; #[cfg(sslv2)] pub fn SSLv2_method() -> *SSL_METHOD; pub fn SSLv3_method() -> *SSL_METHOD; pub fn TLSv1_method() -> *SSL_METHOD; pub fn SSLv23_method() -> *SSL_METHOD; Loading ssl/mod.rs +15 −1 Original line number Diff line number Diff line Loading @@ -38,15 +38,29 @@ fn init() { /// Determines the SSL method supported pub enum SslMethod { #[cfg(sslv2)] /// Only support the SSLv2 protocol Sslv2, /// Only support the SSLv3 protocol Sslv3, /// Only support the TLSv1 protocol Tlsv1, /// Support the SSLv2, SSLv3 and TLSv1 protocols Sslv23 Sslv23, } impl SslMethod { #[cfg(sslv2)] unsafe fn to_raw(&self) -> *ffi::SSL_METHOD { match *self { Sslv2 => ffi::SSLv2_method(), Sslv3 => ffi::SSLv3_method(), Tlsv1 => ffi::TLSv1_method(), Sslv23 => ffi::SSLv23_method() } } #[cfg(not(sslv2))] unsafe fn to_raw(&self) -> *ffi::SSL_METHOD { match *self { Sslv3 => ffi::SSLv3_method(), Loading ssl/tests.rs +1 −0 Original line number Diff line number Diff line use std::from_str::FromStr; use std::io::Writer; use std::io::net::tcp::TcpStream; use std::str; Loading Loading
ssl/ffi.rs +2 −0 Original line number Diff line number Diff line Loading @@ -111,6 +111,8 @@ extern "C" { pub fn SSL_library_init() -> c_int; #[cfg(sslv2)] pub fn SSLv2_method() -> *SSL_METHOD; pub fn SSLv3_method() -> *SSL_METHOD; pub fn TLSv1_method() -> *SSL_METHOD; pub fn SSLv23_method() -> *SSL_METHOD; Loading
ssl/mod.rs +15 −1 Original line number Diff line number Diff line Loading @@ -38,15 +38,29 @@ fn init() { /// Determines the SSL method supported pub enum SslMethod { #[cfg(sslv2)] /// Only support the SSLv2 protocol Sslv2, /// Only support the SSLv3 protocol Sslv3, /// Only support the TLSv1 protocol Tlsv1, /// Support the SSLv2, SSLv3 and TLSv1 protocols Sslv23 Sslv23, } impl SslMethod { #[cfg(sslv2)] unsafe fn to_raw(&self) -> *ffi::SSL_METHOD { match *self { Sslv2 => ffi::SSLv2_method(), Sslv3 => ffi::SSLv3_method(), Tlsv1 => ffi::TLSv1_method(), Sslv23 => ffi::SSLv23_method() } } #[cfg(not(sslv2))] unsafe fn to_raw(&self) -> *ffi::SSL_METHOD { match *self { Sslv3 => ffi::SSLv3_method(), Loading
ssl/tests.rs +1 −0 Original line number Diff line number Diff line use std::from_str::FromStr; use std::io::Writer; use std::io::net::tcp::TcpStream; use std::str; Loading