SSL_CTX_add_session(3) OpenSSL SSL_CTX_add_session(3) NNAAMMEE SSL_CTX_add_session, SSL_add_session, SSL_CTX_remove_session, SSL_remove_session - manipulate session cache SSYYNNOOPPSSIISS #include int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *c); int SSL_add_session(SSL_CTX *ctx, SSL_SESSION *c); int SSL_CTX_remove_session(SSL_CTX *ctx, SSL_SESSION *c); int SSL_remove_session(SSL_CTX *ctx, SSL_SESSION *c); DDEESSCCRRIIPPTTIIOONN _S_S_L___C_T_X___a_d_d___s_e_s_s_i_o_n_(_) adds the session cc to the context ccttxx. The refer- ence count for session cc is incremented by 1. If a session with the same session id already exists, the old session is removed by calling _S_S_L___S_E_S_S_I_O_N___f_r_e_e(3). _S_S_L___C_T_X___r_e_m_o_v_e___s_e_s_s_i_o_n_(_) removes the session cc from the context ccttxx. _S_S_L___S_E_S_S_I_O_N___f_r_e_e(3) is called once for cc. _S_S_L___a_d_d___s_e_s_s_i_o_n_(_) and _S_S_L___r_e_m_o_v_e___s_e_s_s_i_o_n_(_) are synonyms for their SSL_CTX_*() counterparts. NNOOTTEESS When adding a new session to the internal session cache, it is examined whether a session with the same session id already exists. In this case it is assumed that both sessions are identical. If the same session is stored in a different SSL_SESSION object, The old session is removed and replaced by the new session. If the session is actually identical (the SSL_SESSION object is identical), _S_S_L___C_T_X___a_d_d___s_e_s_s_i_o_n_(_) is a no-op, and the return value is 0. If a server SSL_CTX is configured with the SSL_SESS_CACHE_NO_INTER- NAL_STORE flag then the internal cache will not be populated automati- cally by new sessions negotiated by the SSL/TLS implementation, even though the internal cache will be searched automatically for session- resume requests (the latter can be suppressed by SSL_SESS_CACHE_NO_INTERNAL_LOOKUP). So the application can use _S_S_L___C_T_X___a_d_d___s_e_s_s_i_o_n_(_) directly to have full control over the sessions that can be resumed if desired. RREETTUURRNN VVAALLUUEESS The following values are returned by all functions: 0 The operation failed. In case of the add operation, it was tried to add the same (identical) session twice. In case of the remove operation, the session was not found in the cache. 1 The operation succeeded. SSEEEE AALLSSOO _s_s_l(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), _S_S_L___S_E_S_S_I_O_N___f_r_e_e(3) 1.0.1u 2016-09-22 SSL_CTX_add_session(3)