aboutsummaryrefslogtreecommitdiff
path: root/src/ssl/mod.rs
diff options
context:
space:
mode:
authorValerii Hiora <[email protected]>2014-10-04 06:37:48 +0300
committerValerii Hiora <[email protected]>2014-10-04 06:47:27 +0300
commit4d3f9e0520ed25bb55a95f30fd07a2cb4cf74fa5 (patch)
treee1204894c5915ca4fdfd9cc82bf0c663448aa76f /src/ssl/mod.rs
parentUser-provided data in verify (diff)
downloadrust-openssl-4d3f9e0520ed25bb55a95f30fd07a2cb4cf74fa5.tar.xz
rust-openssl-4d3f9e0520ed25bb55a95f30fd07a2cb4cf74fa5.zip
Simpler setter for verify with data
There is no need in wrapping function in option as there is no sense in providing data without function.
Diffstat (limited to 'src/ssl/mod.rs')
-rw-r--r--src/ssl/mod.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ssl/mod.rs b/src/ssl/mod.rs
index e1f35724..ab467f7e 100644
--- a/src/ssl/mod.rs
+++ b/src/ssl/mod.rs
@@ -222,13 +222,15 @@ impl SslContext {
/// Configures the certificate verification method for new connections also
/// carrying supplied data.
+ // Note: no option because there is no point to set data without providing
+ // a function handling it
pub fn set_verify_with_data<T>(&mut self, mode: SslVerifyMode,
- verify: Option<VerifyCallbackData<T>>,
+ verify: VerifyCallbackData<T>,
data: T) {
let data = box data;
unsafe {
ffi::SSL_CTX_set_ex_data(self.ctx, VERIFY_IDX,
- mem::transmute(verify));
+ mem::transmute(Some(verify)));
ffi::SSL_CTX_set_ex_data(self.ctx, get_verify_data_idx::<T>(),
mem::transmute(data));
ffi::SSL_CTX_set_verify(self.ctx, mode as c_int, Some(raw_verify_with_data::<T>));