aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorManuel Schölling <[email protected]>2015-03-19 17:58:23 +0100
committerManuel Schölling <[email protected]>2015-04-03 14:34:24 +0200
commitb6c5c113f56d56723771efdbecfd54d2b2fdd8d5 (patch)
treec63b0bbbbbdc03553d6656f58aa41d0dacb00c30 /openssl/src
parentAdd ability to load private keys from files and use raw keys and certificates... (diff)
downloadrust-openssl-b6c5c113f56d56723771efdbecfd54d2b2fdd8d5.tar.xz
rust-openssl-b6c5c113f56d56723771efdbecfd54d2b2fdd8d5.zip
Add SslContext::add_extra_chain_cert()
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/crypto/pkey.rs1
-rw-r--r--openssl/src/ssl/mod.rs9
2 files changed, 9 insertions, 1 deletions
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<SslError> {
+ 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<SslError> {