1.\" $OpenBSD: SSL_CTX_sess_number.3,v 1.9 2019/06/12 09:36:30 schwarze Exp $ 2.\" OpenSSL SSL_CTX_sess_number.pod 7bd27895 Mar 29 11:45:29 2017 +1000 3.\" 4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>. 5.\" Copyright (c) 2001 The OpenSSL Project. All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in 16.\" the documentation and/or other materials provided with the 17.\" distribution. 18.\" 19.\" 3. All advertising materials mentioning features or use of this 20.\" software must display the following acknowledgment: 21.\" "This product includes software developed by the OpenSSL Project 22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" 23.\" 24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to 25.\" endorse or promote products derived from this software without 26.\" prior written permission. For written permission, please contact 27.\" openssl-core@openssl.org. 28.\" 29.\" 5. Products derived from this software may not be called "OpenSSL" 30.\" nor may "OpenSSL" appear in their names without prior written 31.\" permission of the OpenSSL Project. 32.\" 33.\" 6. Redistributions of any form whatsoever must retain the following 34.\" acknowledgment: 35.\" "This product includes software developed by the OpenSSL Project 36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" 37.\" 38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY 39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR 42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 50.\" 51.Dd $Mdocdate: June 12 2019 $ 52.Dt SSL_CTX_SESS_NUMBER 3 53.Os 54.Sh NAME 55.Nm SSL_CTX_sess_number , 56.Nm SSL_CTX_sess_connect , 57.Nm SSL_CTX_sess_connect_good , 58.Nm SSL_CTX_sess_connect_renegotiate , 59.Nm SSL_CTX_sess_accept , 60.Nm SSL_CTX_sess_accept_good , 61.Nm SSL_CTX_sess_accept_renegotiate , 62.Nm SSL_CTX_sess_hits , 63.Nm SSL_CTX_sess_cb_hits , 64.Nm SSL_CTX_sess_misses , 65.Nm SSL_CTX_sess_timeouts , 66.Nm SSL_CTX_sess_cache_full 67.Nd obtain session cache statistics 68.Sh SYNOPSIS 69.In openssl/ssl.h 70.Ft long 71.Fn SSL_CTX_sess_number "SSL_CTX *ctx" 72.Ft long 73.Fn SSL_CTX_sess_connect "SSL_CTX *ctx" 74.Ft long 75.Fn SSL_CTX_sess_connect_good "SSL_CTX *ctx" 76.Ft long 77.Fn SSL_CTX_sess_connect_renegotiate "SSL_CTX *ctx" 78.Ft long 79.Fn SSL_CTX_sess_accept "SSL_CTX *ctx" 80.Ft long 81.Fn SSL_CTX_sess_accept_good "SSL_CTX *ctx" 82.Ft long 83.Fn SSL_CTX_sess_accept_renegotiate "SSL_CTX *ctx" 84.Ft long 85.Fn SSL_CTX_sess_hits "SSL_CTX *ctx" 86.Ft long 87.Fn SSL_CTX_sess_cb_hits "SSL_CTX *ctx" 88.Ft long 89.Fn SSL_CTX_sess_misses "SSL_CTX *ctx" 90.Ft long 91.Fn SSL_CTX_sess_timeouts "SSL_CTX *ctx" 92.Ft long 93.Fn SSL_CTX_sess_cache_full "SSL_CTX *ctx" 94.Sh DESCRIPTION 95.Fn SSL_CTX_sess_number 96returns the current number of sessions in the internal session cache. 97.Pp 98.Fn SSL_CTX_sess_connect 99returns the number of started SSL/TLS handshakes in client mode. 100.Pp 101.Fn SSL_CTX_sess_connect_good 102returns the number of successfully established SSL/TLS sessions in client mode. 103.Pp 104.Fn SSL_CTX_sess_connect_renegotiate 105returns the number of started renegotiations in client mode. 106.Pp 107.Fn SSL_CTX_sess_accept 108returns the number of started SSL/TLS handshakes in server mode. 109.Pp 110.Fn SSL_CTX_sess_accept_good 111returns the number of successfully established SSL/TLS sessions in server mode. 112.Pp 113.Fn SSL_CTX_sess_accept_renegotiate 114returns the number of started renegotiations in server mode. 115.Pp 116.Fn SSL_CTX_sess_hits 117returns the number of successfully reused sessions. 118In client mode a session set with 119.Xr SSL_set_session 3 120successfully reused is counted as a hit. 121In server mode a session successfully retrieved from internal or external cache 122is counted as a hit. 123.Pp 124.Fn SSL_CTX_sess_cb_hits 125returns the number of successfully retrieved sessions from the external session 126cache in server mode. 127.Pp 128.Fn SSL_CTX_sess_misses 129returns the number of sessions proposed by clients that were not found in the 130internal session cache in server mode. 131.Pp 132.Fn SSL_CTX_sess_timeouts 133returns the number of sessions proposed by clients and either found in the 134internal or external session cache in server mode, 135but that were invalid due to timeout. 136These sessions are not included in the 137.Fn SSL_CTX_sess_hits 138count. 139.Pp 140.Fn SSL_CTX_sess_cache_full 141returns the number of sessions that were removed because the maximum session 142cache size was exceeded. 143.Sh SEE ALSO 144.Xr ssl 3 , 145.Xr SSL_CTX_ctrl 3 , 146.Xr SSL_CTX_sess_set_cache_size 3 , 147.Xr SSL_CTX_set_session_cache_mode 3 , 148.Xr SSL_set_session 3 149.Sh HISTORY 150.Fn SSL_CTX_sess_number , 151.Fn SSL_CTX_sess_connect , 152.Fn SSL_CTX_sess_connect_good , 153.Fn SSL_CTX_sess_accept , 154.Fn SSL_CTX_sess_accept_good , 155.Fn SSL_CTX_sess_hits , 156.Fn SSL_CTX_sess_misses , 157and 158.Fn SSL_CTX_sess_timeouts 159first appeared in SSLeay 0.5.2. 160.Fn SSL_CTX_sess_cb_hits 161first appeared in SSLeay 0.6.0. 162.Fn SSL_CTX_sess_connect_renegotiate , 163.Fn SSL_CTX_sess_accept_renegotiate , 164and 165.Fn SSL_CTX_sess_cache_full 166first appeared in SSLeay 0.9.0. 167All these functions have been available since 168.Ox 2.4 . 169