diff options
| author | Cody P Schafer <[email protected]> | 2014-09-23 16:59:24 -0400 |
|---|---|---|
| committer | Cody P Schafer <[email protected]> | 2014-10-13 16:22:12 -0400 |
| commit | a6af89c67bf3c0ea562e960ba3e51c772b9e1be0 (patch) | |
| tree | d2574c6ae402635915ae70073027f8e7dd67981b | |
| parent | Merge pull request #79 from jroesch/init-cleanup (diff) | |
| download | rust-openssl-a6af89c67bf3c0ea562e960ba3e51c772b9e1be0.tar.xz rust-openssl-a6af89c67bf3c0ea562e960ba3e51c772b9e1be0.zip | |
ssl: allow setting cipher list
| -rwxr-xr-x | src/ffi.rs | 1 | ||||
| -rw-r--r-- | src/ssl/mod.rs | 8 |
2 files changed, 9 insertions, 0 deletions
@@ -408,6 +408,7 @@ extern "C" { pub fn SSL_CTX_use_certificate_file(ctx: *mut SSL_CTX, cert_file: *const c_char, file_type: c_int) -> c_int; pub fn SSL_CTX_use_PrivateKey_file(ctx: *mut SSL_CTX, key_file: *const c_char, file_type: c_int) -> c_int; + pub fn SSL_CTX_set_cipher_list(ssl: *mut SSL_CTX, s: *const c_char) -> c_int; pub fn X509_add_ext(x: *mut X509, ext: *mut X509_EXTENSION, loc: c_int) -> c_int; pub fn X509_digest(x: *mut X509, digest: *const EVP_MD, buf: *mut c_char, len: *mut c_uint) -> c_int; diff --git a/src/ssl/mod.rs b/src/ssl/mod.rs index 33112f7a..86b3ec83 100644 --- a/src/ssl/mod.rs +++ b/src/ssl/mod.rs @@ -276,6 +276,14 @@ impl SslContext { } })) } + + pub fn set_cipher_list(&mut self, cipher_list: &str) -> Option<SslError> { + wrap_ssl_result(cipher_list.with_c_str(|cipher_list| { + unsafe { + ffi::SSL_CTX_set_cipher_list(self.ctx, cipher_list) + } + })) + } } #[allow(dead_code)] |