SSL_set_session 3 2002-06-09 0.9.9-dev OpenSSL
NAME
SSL_set_session - set a TLS/SSL session to be used during TLS/SSL connect
LIBRARY
libcrypto, -lcrypto
SYNOPSIS
#include
int SSL_set_session(SSL *ssl, SSL_SESSION *session);
DESCRIPTION
_S_S_L___s_e_t___s_e_s_s_i_o_n_(_) sets sseessssiioonn to be used when the TLS/SSL connection
is to be established. _S_S_L___s_e_t___s_e_s_s_i_o_n_(_) is only useful for TLS/SSL clients.
When the session is set, the reference count of sseessssiioonn is incremented
by 1. If the session is not reused, the reference count is decremented
again during _S_S_L___c_o_n_n_e_c_t_(_). Whether the session was reused can be queried
with the _S_S_L___s_e_s_s_i_o_n___r_e_u_s_e_d(3) call.
If there is already a session set inside ssssll (because it was set with
_S_S_L___s_e_t___s_e_s_s_i_o_n_(_) before or because the same ssssll was already used for
a connection), _S_S_L___S_E_S_S_I_O_N___f_r_e_e_(_) will be called for that session.
NOTES
SSL_SESSION objects keep internal link information about the session cache
list, when being inserted into one SSL_CTX object's session cache.
One SSL_SESSION object, regardless of its reference count, must therefore
only be used with one SSL_CTX object (and the SSL objects created
from this SSL_CTX object).
RETURN VALUES
The following return values can occur:
-
0
The operation failed; check the error stack to find out the reason.
-
-
1
The operation succeeded.
-
SEE ALSO
_s_s_l(3), _S_S_L___S_E_S_S_I_O_N___f_r_e_e(3),
_S_S_L___g_e_t___s_e_s_s_i_o_n(3),
_S_S_L___s_e_s_s_i_o_n___r_e_u_s_e_d(3),
_S_S_L___C_T_X___s_e_t___s_e_s_s_i_o_n___c_a_c_h_e___m_o_d_e(3)