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