diff options
| author | bentley <> | 2014-10-12 09:33:04 +0000 |
|---|---|---|
| committer | bentley <> | 2014-10-12 09:33:04 +0000 |
| commit | 78332233d01faa45e0bb0b1583d47cb5ad1ddc19 (patch) | |
| tree | a5087bf8d016a6041c2b6822fbecfd8f6c5e70b1 /src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3 | |
| parent | 4e737c824fafe5f105e5f4849a9db2569b5d53d8 (diff) | |
| download | openbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.tar.gz openbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.tar.bz2 openbsd-78332233d01faa45e0bb0b1583d47cb5ad1ddc19.zip | |
Convert libssl manpages from pod to mdoc(7).
libcrypto has not been started yet.
ok schwarze@ miod@
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3')
| -rw-r--r-- | src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3 | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3 b/src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3 new file mode 100644 index 0000000000..e7ebe2190e --- /dev/null +++ b/src/lib/libssl/doc/SSL_CTX_set_session_cache_mode.3 | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | .Dd $Mdocdate: October 12 2014 $ | ||
| 2 | .Dt SSL_CTX_SET_SESSION_CACHE_MODE 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm SSL_CTX_set_session_cache_mode , | ||
| 6 | .Nm SSL_CTX_get_session_cache_mode | ||
| 7 | .Nd enable/disable session caching | ||
| 8 | .Sh SYNOPSIS | ||
| 9 | .In openssl/ssl.h | ||
| 10 | .Ft long | ||
| 11 | .Fn SSL_CTX_set_session_cache_mode "SSL_CTX ctx" "long mode" | ||
| 12 | .Ft long | ||
| 13 | .Fn SSL_CTX_get_session_cache_mode "SSL_CTX ctx" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | .Fn SSL_CTX_set_session_cache_mode | ||
| 16 | enables/disables session caching by setting the operational mode for | ||
| 17 | .Ar ctx | ||
| 18 | to | ||
| 19 | .Ar mode . | ||
| 20 | .Pp | ||
| 21 | .Fn SSL_CTX_get_session_cache_mode | ||
| 22 | returns the currently used cache mode. | ||
| 23 | .Sh NOTES | ||
| 24 | The OpenSSL library can store/retrieve SSL/TLS sessions for later reuse. | ||
| 25 | The sessions can be held in memory for each | ||
| 26 | .Fa ctx , | ||
| 27 | if more than one | ||
| 28 | .Vt SSL_CTX | ||
| 29 | object is being maintained, the sessions are unique for each | ||
| 30 | .Vt SSL_CTX | ||
| 31 | object. | ||
| 32 | .Pp | ||
| 33 | In order to reuse a session, a client must send the session's id to the server. | ||
| 34 | It can only send exactly one id. | ||
| 35 | The server then either agrees to reuse the session or it starts a full | ||
| 36 | handshake (to create a new session). | ||
| 37 | .Pp | ||
| 38 | A server will lookup up the session in its internal session storage. | ||
| 39 | If the session is not found in internal storage or lookups for the internal | ||
| 40 | storage have been deactivated | ||
| 41 | .Pq Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP , | ||
| 42 | the server will try the external storage if available. | ||
| 43 | .Pp | ||
| 44 | Since a client may try to reuse a session intended for use in a different | ||
| 45 | context, the session id context must be set by the server (see | ||
| 46 | .Xr SSL_CTX_set_session_id_context 3 ) . | ||
| 47 | .Pp | ||
| 48 | The following session cache modes and modifiers are available: | ||
| 49 | .Bl -tag -width Ds | ||
| 50 | .It Dv SSL_SESS_CACHE_OFF | ||
| 51 | No session caching for client or server takes place. | ||
| 52 | .It Dv SSL_SESS_CACHE_CLIENT | ||
| 53 | Client sessions are added to the session cache. | ||
| 54 | As there is no reliable way for the OpenSSL library to know whether a session | ||
| 55 | should be reused or which session to choose (due to the abstract BIO layer the | ||
| 56 | SSL engine does not have details about the connection), | ||
| 57 | the application must select the session to be reused by using the | ||
| 58 | .Xr SSL_set_session 3 | ||
| 59 | function. | ||
| 60 | This option is not activated by default. | ||
| 61 | .It Dv SSL_SESS_CACHE_SERVER | ||
| 62 | Server sessions are added to the session cache. | ||
| 63 | When a client proposes a session to be reused, the server looks for the | ||
| 64 | corresponding session in (first) the internal session cache (unless | ||
| 65 | .Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | ||
| 66 | is set), then (second) in the external cache if available. | ||
| 67 | If the session is found, the server will try to reuse the session. | ||
| 68 | This is the default. | ||
| 69 | .It Dv SSL_SESS_CACHE_BOTH | ||
| 70 | Enable both | ||
| 71 | .Dv SSL_SESS_CACHE_CLIENT | ||
| 72 | and | ||
| 73 | .Dv SSL_SESS_CACHE_SERVER | ||
| 74 | at the same time. | ||
| 75 | .It Dv SSL_SESS_CACHE_NO_AUTO_CLEAR | ||
| 76 | Normally the session cache is checked for expired sessions every 255 | ||
| 77 | connections using the | ||
| 78 | .Xr SSL_CTX_flush_sessions 3 | ||
| 79 | function. | ||
| 80 | Since this may lead to a delay which cannot be controlled, | ||
| 81 | the automatic flushing may be disabled and | ||
| 82 | .Xr SSL_CTX_flush_sessions 3 | ||
| 83 | can be called explicitly by the application. | ||
| 84 | .It Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | ||
| 85 | By setting this flag, session-resume operations in an SSL/TLS server will not | ||
| 86 | automatically look up sessions in the internal cache, | ||
| 87 | even if sessions are automatically stored there. | ||
| 88 | If external session caching callbacks are in use, | ||
| 89 | this flag guarantees that all lookups are directed to the external cache. | ||
| 90 | As automatic lookup only applies for SSL/TLS servers, | ||
| 91 | the flag has no effect on clients. | ||
| 92 | .It Dv SSL_SESS_CACHE_NO_INTERNAL_STORE | ||
| 93 | Depending on the presence of | ||
| 94 | .Dv SSL_SESS_CACHE_CLIENT | ||
| 95 | and/or | ||
| 96 | .Dv SSL_SESS_CACHE_SERVER, | ||
| 97 | sessions negotiated in an SSL/TLS handshake may be cached for possible reuse. | ||
| 98 | Normally a new session is added to the internal cache as well as any external | ||
| 99 | session caching (callback) that is configured for the | ||
| 100 | .Vt SSL_CTX . | ||
| 101 | This flag will prevent sessions being stored in the internal cache | ||
| 102 | (though the application can add them manually using | ||
| 103 | .Xr SSL_CTX_add_session 3 ) . | ||
| 104 | Note: | ||
| 105 | in any SSL/TLS servers where external caching is configured, any successful | ||
| 106 | session lookups in the external cache (e.g., for session-resume requests) would | ||
| 107 | normally be copied into the local cache before processing continues \(en this | ||
| 108 | flag prevents these additions to the internal cache as well. | ||
| 109 | .It Dv SSL_SESS_CACHE_NO_INTERNAL | ||
| 110 | Enable both | ||
| 111 | .Dv SSL_SESS_CACHE_NO_INTERNAL_LOOKUP | ||
| 112 | and | ||
| 113 | .Dv SSL_SESS_CACHE_NO_INTERNAL_STORE | ||
| 114 | at the same time. | ||
| 115 | .El | ||
| 116 | .Pp | ||
| 117 | The default mode is | ||
| 118 | .Dv SSL_SESS_CACHE_SERVER . | ||
| 119 | .Sh RETURN VALUES | ||
| 120 | .Fn SSL_CTX_set_session_cache_mode | ||
| 121 | returns the previously set cache mode. | ||
| 122 | .Pp | ||
| 123 | .Fn SSL_CTX_get_session_cache_mode | ||
| 124 | returns the currently set cache mode. | ||
| 125 | .Sh SEE ALSO | ||
| 126 | .Xr ssl 3 , | ||
| 127 | .Xr SSL_CTX_add_session 3 , | ||
| 128 | .Xr SSL_CTX_flush_sessions 3 , | ||
| 129 | .Xr SSL_CTX_sess_number 3 , | ||
| 130 | .Xr SSL_CTX_sess_set_cache_size 3 , | ||
| 131 | .Xr SSL_CTX_sess_set_get_cb 3 , | ||
| 132 | .Xr SSL_CTX_set_session_id_context 3 , | ||
| 133 | .Xr SSL_CTX_set_timeout 3 , | ||
| 134 | .Xr SSL_session_reused 3 , | ||
| 135 | .Xr SSL_set_session 3 | ||
| 136 | .Sh HISTORY | ||
| 137 | .Dv SSL_SESS_CACHE_NO_INTERNAL_STORE | ||
| 138 | and | ||
| 139 | .Dv SSL_SESS_CACHE_NO_INTERNAL | ||
| 140 | were introduced in OpenSSL 0.9.6h. | ||
