aboutsummaryrefslogtreecommitdiff
path: root/src/ssl/ffi.rs
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2014-09-25 02:43:36 -0400
committerSteven Fackler <[email protected]>2014-09-25 02:43:36 -0400
commitfa53c79e4892dfc260bc6d1e2b52892f5607de72 (patch)
treed099a2732f2702423220b686b2cc010386da4f62 /src/ssl/ffi.rs
parentMerge pull request #51 from ebfe/deprecated (diff)
parentTLS 1_1, 1_2, Ssl 2 is enabled by features (diff)
downloadrust-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/ffi.rs')
-rwxr-xr-xsrc/ssl/ffi.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ssl/ffi.rs b/src/ssl/ffi.rs
index 2e21a24b..a40af35e 100755
--- a/src/ssl/ffi.rs
+++ b/src/ssl/ffi.rs
@@ -103,8 +103,18 @@ pub static X509_FILETYPE_PEM: c_int = 1;
pub static X509_FILETYPE_ASN1: c_int = 2;
pub static X509_FILETYPE_DEFAULT: c_int = 3;
+#[cfg(target_os = "macos", feature = "tlsv1_1")]
+#[cfg(target_os = "macos", feature = "tlsv1_2")]
+#[link(name="ssl.1.0.0")]
+#[link(name="crypto.1.0.0")]
+extern {}
+
+#[cfg(not(target_os = "macos"))]
+#[cfg(target_os = "macos", not(feature = "tlsv1_1"), not(feature = "tlsv1_2"))]
#[link(name="ssl")]
#[link(name="crypto")]
+extern {}
+
extern "C" {
pub fn CRYPTO_num_locks() -> c_int;
pub fn CRYPTO_set_locking_callback(func: extern "C" fn(mode: c_int,
@@ -116,10 +126,14 @@ extern "C" {
pub fn SSL_library_init() -> c_int;
- #[cfg(sslv2)]
+ #[cfg(feature = "sslv2")]
pub fn SSLv2_method() -> *const SSL_METHOD;
pub fn SSLv3_method() -> *const SSL_METHOD;
pub fn TLSv1_method() -> *const SSL_METHOD;
+ #[cfg(feature = "tlsv1_1")]
+ pub fn TLSv1_1_method() -> *const SSL_METHOD;
+ #[cfg(feature = "tlsv1_2")]
+ pub fn TLSv1_2_method() -> *const SSL_METHOD;
pub fn SSLv23_method() -> *const SSL_METHOD;
pub fn SSL_CTX_new(method: *const SSL_METHOD) -> *mut SSL_CTX;