Commit c2a7c5b7 authored by Steven Fackler's avatar Steven Fackler
Browse files

Move SSL_set_tlsext_host_name to -sys

parent b29ea624
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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())
}

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
extern "C" {
    pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int;
+1 −1
Original line number Diff line number Diff line
@@ -893,7 +893,7 @@ impl Ssl {
    pub fn set_hostname(&self, hostname: &str) -> Result<(), ErrorStack> {
        let cstr = CString::new(hostname).unwrap();
        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.