From b6c5c113f56d56723771efdbecfd54d2b2fdd8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Sch=C3=B6lling?= Date: Thu, 19 Mar 2015 17:58:23 +0100 Subject: Add SslContext::add_extra_chain_cert() --- openssl/src/crypto/pkey.rs | 1 - openssl/src/ssl/mod.rs | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'openssl/src') diff --git a/openssl/src/crypto/pkey.rs b/openssl/src/crypto/pkey.rs index a4c6fb12..8454f252 100644 --- a/openssl/src/crypto/pkey.rs +++ b/openssl/src/crypto/pkey.rs @@ -352,7 +352,6 @@ impl Drop for PKey { #[cfg(test)] mod tests { - use std::io; use std::path::Path; use std::fs::File; use crypto::hash::Type::{MD5, SHA1}; diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 578cfcd5..89abf59f 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -409,6 +409,15 @@ impl SslContext { }) } + /// Adds a certificate to the certificate chain presented together with the + /// certificate specified using set_certificate() + pub fn add_extra_chain_cert(&mut self, cert: &X509) -> Option { + wrap_ssl_result( + unsafe { + ffi::SSL_CTX_add_extra_chain_cert(*self.ctx, cert.get_handle()) as c_int + }) + } + /// Specifies the file that contains private key pub fn set_private_key_file(&mut self, file: &Path, file_type: X509FileType) -> Option { -- cgit v1.2.3