Loading openssl-sys/src/lib.rs +4 −0 Original line number Diff line number Diff line Loading @@ -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; Loading openssl/src/ssl/mod.rs +1 −1 Original line number Diff line number Diff line Loading @@ -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. Loading Loading
openssl-sys/src/lib.rs +4 −0 Original line number Diff line number Diff line Loading @@ -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; Loading
openssl/src/ssl/mod.rs +1 −1 Original line number Diff line number Diff line Loading @@ -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. Loading