From dba3a0ced24147414abaa9f8394b9f249b08f599 Mon Sep 17 00:00:00 2001 From: Geoffroy Couprie Date: Sun, 22 Nov 2015 20:01:41 +0100 Subject: implement get/set ssl context --- openssl/src/ssl/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'openssl/src') diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index f73c263a..736e6b4c 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -982,6 +982,14 @@ impl Ssl { } } + pub fn set_ssl_context(&self, ctx: &SslContext) -> SslContext { + SslContext { ctx: unsafe { ffi::SSL_set_SSL_CTX(self.ssl, ctx.ctx) } } + } + + pub fn get_ssl_context(&self) -> SslContext { + let ssl_ctx = unsafe { ffi::SSL_get_SSL_CTX(self.ssl) }; + SslContext { ctx: ssl_ctx } + } } macro_rules! make_LibSslError { -- cgit v1.2.3