1=pod 2 3=head1 NAME 4 5SSL_set_session - set a TLS/SSL session to be used during TLS/SSL connect 6 7=head1 SYNOPSIS 8 9 #include <openssl/ssl.h> 10 11 int SSL_set_session(SSL *ssl, SSL_SESSION *session); 12 13=head1 DESCRIPTION 14 15SSL_set_session() sets B<session> to be used when the TLS/SSL connection 16is to be established. SSL_set_session() is only useful for TLS/SSL clients. 17When the session is set, the reference count of B<session> is incremented 18by 1. If the session is not reused, the reference count is decremented 19again during SSL_connect(). Whether the session was reused can be queried 20with the L<SSL_session_reused(3)|SSL_session_reused(3)> call. 21 22If there is already a session set inside B<ssl> (because it was set with 23SSL_set_session() before or because the same B<ssl> was already used for 24a connection), SSL_SESSION_free() will be called for that session. 25 26=head1 NOTES 27 28SSL_SESSION objects keep internal link information about the session cache 29list, when being inserted into one SSL_CTX object's session cache. 30One SSL_SESSION object, regardless of its reference count, must therefore 31only be used with one SSL_CTX object (and the SSL objects created 32from this SSL_CTX object). 33 34=head1 RETURN VALUES 35 36The following return values can occur: 37 38=over 4 39 40=item 0 41 42The operation failed; check the error stack to find out the reason. 43 44=item 1 45 46The operation succeeded. 47 48=back 49 50=head1 SEE ALSO 51 52L<ssl(3)|ssl(3)>, L<SSL_SESSION_free(3)|SSL_SESSION_free(3)>, 53L<SSL_get_session(3)|SSL_get_session(3)>, 54L<SSL_session_reused(3)|SSL_session_reused(3)>, 55L<SSL_CTX_set_session_cache_mode(3)|SSL_CTX_set_session_cache_mode(3)> 56 57=cut 58