aboutsummaryrefslogtreecommitdiff
path: root/src/ssl/ffi.rs
diff options
context:
space:
mode:
authorAndrew Dunham <[email protected]>2014-09-04 18:21:43 -0700
committerAndrew Dunham <[email protected]>2014-09-04 18:21:43 -0700
commitfc79815faf28b347f6f0b8dd6d7c4f6b83fc4e53 (patch)
tree7e53c8274042fb333b374cf2051954e7c3b75ead /src/ssl/ffi.rs
parentMerge pull request #35 from Kroisse/master (diff)
downloadrust-openssl-fc79815faf28b347f6f0b8dd6d7c4f6b83fc4e53.tar.xz
rust-openssl-fc79815faf28b347f6f0b8dd6d7c4f6b83fc4e53.zip
Allow setting hostname to support TLS-SNI
Diffstat (limited to 'src/ssl/ffi.rs')
-rw-r--r--src/ssl/ffi.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ssl/ffi.rs b/src/ssl/ffi.rs
index 4677c189..3fa6c9f4 100644
--- a/src/ssl/ffi.rs
+++ b/src/ssl/ffi.rs
@@ -38,6 +38,10 @@ pub static SSL_ERROR_WANT_ACCEPT: c_int = 8;
pub static SSL_VERIFY_NONE: c_int = 0;
pub static SSL_VERIFY_PEER: c_int = 1;
+pub static SSL_CTRL_SET_TLSEXT_HOSTNAME: c_int = 55;
+
+pub static TLSEXT_NAMETYPE_host_name: c_long = 0;
+
pub static X509_V_OK: c_int = 0;
pub static X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT: c_int = 2;
pub static X509_V_ERR_UNABLE_TO_GET_CRL: c_int = 3;
@@ -140,6 +144,8 @@ extern "C" {
pub fn SSL_get_rbio(ssl: *mut SSL) -> *mut BIO;
pub fn SSL_get_wbio(ssl: *mut SSL) -> *mut BIO;
pub fn SSL_connect(ssl: *mut SSL) -> c_int;
+ pub fn SSL_ctrl(ssl: *mut SSL, cmd: c_int, larg: c_long,
+ parg: *mut c_void) -> c_long;
pub fn SSL_get_error(ssl: *mut SSL, ret: c_int) -> c_int;
pub fn SSL_read(ssl: *mut SSL, buf: *mut c_void, num: c_int) -> c_int;
pub fn SSL_write(ssl: *mut SSL, buf: *const c_void, num: c_int) -> c_int;