5 SSL_set_session - set a TLS/SSL session to be used during TLS/SSL connect
9 #include <openssl/ssl.h>
11 int SSL_set_session(SSL *ssl, SSL_SESSION *session);
15 SSL_set_session() sets B<session> to be used when the TLS/SSL connection
16 is to be established. SSL_set_session() is only useful for TLS/SSL clients.
17 When the session is set, the reference count of B<session> is incremented
18 by 1. If the session is not reused, the reference count is decremented
19 again during SSL_connect(). Whether the session was reused can be queried
20 with the L<SSL_session_reused(3)|SSL_session_reused(3)> call.
22 If there is already a session set inside B<ssl> (because it was set with
23 SSL_set_session() before or because the same B<ssl> was already used for
24 a connection), SSL_SESSION_free() will be called for that session.
28 The following return values can occur:
34 The operation failed; check the error stack to find out the reason.
38 The operation succeeded.
44 L<ssl(3)|ssl(3)>, L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>,
45 L<SSL_session_reused(3)|SSL_session_reused(3)>,
46 L<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)>