Move SSL_set_tlsext_host_name to -sys

This commit is contained in:
Steven Fackler 2016-08-04 22:28:33 -07:00
parent b29ea62491
commit c2a7c5b7f0
2 changed files with 5 additions and 1 deletions

View File

@ -531,6 +531,10 @@ pub unsafe fn SSL_CTX_get_options(ctx: *mut SSL_CTX) -> c_long {
SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, 0, ptr::null_mut()) SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, 0, ptr::null_mut())
} }
pub unsafe fn SSL_set_tlsext_host_name(s: *mut SSL, name: *mut c_char) -> c_long {
SSL_ctrl(s, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, name as *mut c_void)
}
// True functions // True functions
extern "C" { extern "C" {
pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int; pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int;

View File

@ -893,7 +893,7 @@ impl Ssl {
pub fn set_hostname(&self, hostname: &str) -> Result<(), ErrorStack> { pub fn set_hostname(&self, hostname: &str) -> Result<(), ErrorStack> {
let cstr = CString::new(hostname).unwrap(); let cstr = CString::new(hostname).unwrap();
let ret = unsafe { let ret = unsafe {
ffi_extras::SSL_set_tlsext_host_name(self.ssl, cstr.as_ptr() as *const _) ffi::SSL_set_tlsext_host_name(self.ssl, cstr.as_ptr() as *mut _)
}; };
// For this case, 0 indicates failure. // For this case, 0 indicates failure.