diff options
| author | Steven Fackler <[email protected]> | 2015-03-07 08:43:30 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-03-07 08:43:30 -0800 |
| commit | 8b8736fb4611c99a3d644a831ed5ba0a352cf111 (patch) | |
| tree | b40390bc3d7c0885f7319a9fd9351e992e1ef9ee /openssl/src/ssl/tests.rs | |
| parent | Merge pull request #175 from aatxe/master (diff) | |
| parent | add support for SSL_CTX_clear_options and use bitflags (diff) | |
| download | rust-openssl-8b8736fb4611c99a3d644a831ed5ba0a352cf111.tar.xz rust-openssl-8b8736fb4611c99a3d644a831ed5ba0a352cf111.zip | |
Merge pull request #172 from reaperhulk/add-ssl-ctx-set-get-options
add support for SSL_CTX_set_options and SSL_CTX_get_options
Diffstat (limited to 'openssl/src/ssl/tests.rs')
| -rw-r--r-- | openssl/src/ssl/tests.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/openssl/src/ssl/tests.rs b/openssl/src/ssl/tests.rs index 41e54baa..5196b870 100644 --- a/openssl/src/ssl/tests.rs +++ b/openssl/src/ssl/tests.rs @@ -5,6 +5,7 @@ use std::io::prelude::*; use std::path::Path; use crypto::hash::Type::{SHA256}; +use ssl; use ssl::SslMethod::Sslv23; use ssl::{SslContext, SslStream, VerifyCallback}; use ssl::SslVerifyMode::SslVerifyPeer; @@ -175,6 +176,30 @@ fn test_verify_callback_data() { } } +#[test] +fn test_get_ctx_options() { + let mut ctx = SslContext::new(Sslv23).unwrap(); + ctx.get_options(); +} + +#[test] +fn test_set_ctx_options() { + let mut ctx = SslContext::new(Sslv23).unwrap(); + let opts = ctx.set_options(ssl::SSL_OP_NO_TICKET); + assert!(opts.contains(ssl::SSL_OP_NO_TICKET)); + assert!(!opts.contains(ssl::SSL_OP_CISCO_ANYCONNECT)); + let more_opts = ctx.set_options(ssl::SSL_OP_CISCO_ANYCONNECT); + assert!(more_opts.contains(ssl::SSL_OP_NO_TICKET)); + assert!(more_opts.contains(ssl::SSL_OP_CISCO_ANYCONNECT)); +} + +#[test] +fn test_clear_ctx_options() { + let mut ctx = SslContext::new(Sslv23).unwrap(); + ctx.set_options(ssl::SSL_OP_ALL); + let opts = ctx.clear_options(ssl::SSL_OP_ALL); + assert!(!opts.contains(ssl::SSL_OP_ALL)); +} #[test] fn test_write() { |