parent
3ea2a9cb5f
commit
f520aa2860
|
|
@ -587,6 +587,7 @@ extern {
|
||||||
pub fn SSL_get_ex_data_X509_STORE_CTX_idx() -> c_int;
|
pub fn SSL_get_ex_data_X509_STORE_CTX_idx() -> c_int;
|
||||||
pub fn SSL_get_SSL_CTX(ssl: *const SSL) -> *mut SSL_CTX;
|
pub fn SSL_get_SSL_CTX(ssl: *const SSL) -> *mut SSL_CTX;
|
||||||
pub fn SSL_set_SSL_CTX(ssl: *mut SSL, ctx: *mut SSL_CTX) -> *mut SSL_CTX;
|
pub fn SSL_set_SSL_CTX(ssl: *mut SSL, ctx: *mut SSL_CTX) -> *mut SSL_CTX;
|
||||||
|
#[cfg(not(osslconf = "OPENSSL_NO_COMP"))]
|
||||||
pub fn SSL_get_current_compression(ssl: *mut SSL) -> *const COMP_METHOD;
|
pub fn SSL_get_current_compression(ssl: *mut SSL) -> *const COMP_METHOD;
|
||||||
pub fn SSL_get_peer_certificate(ssl: *const SSL) -> *mut X509;
|
pub fn SSL_get_peer_certificate(ssl: *const SSL) -> *mut X509;
|
||||||
pub fn SSL_get_ssl_method(ssl: *mut SSL) -> *const SSL_METHOD;
|
pub fn SSL_get_ssl_method(ssl: *mut SSL) -> *const SSL_METHOD;
|
||||||
|
|
@ -603,6 +604,7 @@ extern {
|
||||||
#[cfg(not(ossl101))]
|
#[cfg(not(ossl101))]
|
||||||
pub fn SSL_get0_param(ssl: *mut ::SSL) -> *mut X509_VERIFY_PARAM;
|
pub fn SSL_get0_param(ssl: *mut ::SSL) -> *mut X509_VERIFY_PARAM;
|
||||||
|
|
||||||
|
#[cfg(not(osslconf = "OPENSSL_NO_COMP"))]
|
||||||
pub fn SSL_COMP_get_name(comp: *const COMP_METHOD) -> *const c_char;
|
pub fn SSL_COMP_get_name(comp: *const COMP_METHOD) -> *const c_char;
|
||||||
|
|
||||||
pub fn SSL_CIPHER_get_name(cipher: *const SSL_CIPHER) -> *const c_char;
|
pub fn SSL_CIPHER_get_name(cipher: *const SSL_CIPHER) -> *const c_char;
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,9 @@ fn main() {
|
||||||
if env::var("DEP_OPENSSL_IS_110").is_ok() {
|
if env::var("DEP_OPENSSL_IS_110").is_ok() {
|
||||||
println!("cargo:rustc-cfg=ossl110");
|
println!("cargo:rustc-cfg=ossl110");
|
||||||
}
|
}
|
||||||
|
if let Ok(vars) = env::var("DEP_OPENSSL_OSSLCONF") {
|
||||||
|
for var in vars.split(",") {
|
||||||
|
println!("cargo:rustc-cfg=osslconf=\"{}\"", var);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -952,6 +952,11 @@ impl<'a> SslRef<'a> {
|
||||||
/// The result will be either None, indicating no compression is in use, or
|
/// The result will be either None, indicating no compression is in use, or
|
||||||
/// a string with the compression name.
|
/// a string with the compression name.
|
||||||
pub fn compression(&self) -> Option<String> {
|
pub fn compression(&self) -> Option<String> {
|
||||||
|
self._compression()
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(osslconf = "OPENSSL_NO_COMP"))]
|
||||||
|
fn _compression(&self) -> Option<String> {
|
||||||
let ptr = unsafe { ffi::SSL_get_current_compression(self.as_ptr()) };
|
let ptr = unsafe { ffi::SSL_get_current_compression(self.as_ptr()) };
|
||||||
if ptr == ptr::null() {
|
if ptr == ptr::null() {
|
||||||
return None;
|
return None;
|
||||||
|
|
@ -965,6 +970,11 @@ impl<'a> SslRef<'a> {
|
||||||
Some(s)
|
Some(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(osslconf = "OPENSSL_NO_COMP")]
|
||||||
|
fn _compression(&self) -> Option<String> {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the server's name for the current connection
|
/// Returns the server's name for the current connection
|
||||||
pub fn servername(&self) -> Option<String> {
|
pub fn servername(&self) -> Option<String> {
|
||||||
let name = unsafe { ffi::SSL_get_servername(self.as_ptr(), ffi::TLSEXT_NAMETYPE_host_name) };
|
let name = unsafe { ffi::SSL_get_servername(self.as_ptr(), ffi::TLSEXT_NAMETYPE_host_name) };
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue