diff options
| author | Rico Huijbers <[email protected]> | 2016-04-13 21:23:05 +0200 |
|---|---|---|
| committer | Rico Huijbers <[email protected]> | 2016-04-13 21:38:23 +0200 |
| commit | 00282de2a520c17fda9c3e194815fa3c6a00e7b3 (patch) | |
| tree | f10caf454a8a0bf806c8c1da4b5ee6f387691fae /openssl/src | |
| parent | Merge pull request #376 from kcking/kcking-copy-pkey-using-der (diff) | |
| download | rust-openssl-00282de2a520c17fda9c3e194815fa3c6a00e7b3.tar.xz rust-openssl-00282de2a520c17fda9c3e194815fa3c6a00e7b3.zip | |
Add ability to set session ID context on an SSL context
This is necessary to make authentication with client certificates work
without session restarts.
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/ssl/mod.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 7b5cf492..71a6ccda 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -621,6 +621,20 @@ impl SslContext { }) } + /// Set the context identifier for sessions + /// + /// This value identifies the server's session cache to a clients, telling them when they're + /// able to reuse sessions. Should be set to a unique value per server, unless multiple servers + /// share a session cache. + /// + /// This value should be set when using client certificates, or each request will fail + /// handshake and need to be restarted. + pub fn set_session_id_context(&mut self, sid_ctx: &[u8]) -> Result<(), SslError> { + wrap_ssl_result(unsafe { + ffi::SSL_CTX_set_session_id_context(self.ctx, sid_ctx.as_ptr(), sid_ctx.len() as u32) + }) + } + /// Specifies the file that contains certificate pub fn set_certificate_file<P: AsRef<Path>>(&mut self, file: P, |