Blame doc/man3/SSL_set_session.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SSL_set_session - set a TLS/SSL session to be used during TLS/SSL connect
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ssl.h>
Packit c4476c
Packit c4476c
 int SSL_set_session(SSL *ssl, SSL_SESSION *session);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
SSL_set_session() sets B<session> to be used when the TLS/SSL connection
Packit c4476c
is to be established. SSL_set_session() is only useful for TLS/SSL clients.
Packit c4476c
When the session is set, the reference count of B<session> is incremented
Packit c4476c
by 1. If the session is not reused, the reference count is decremented
Packit c4476c
again during SSL_connect(). Whether the session was reused can be queried
Packit c4476c
with the L<SSL_session_reused(3)> call.
Packit c4476c
Packit c4476c
If there is already a session set inside B<ssl> (because it was set with
Packit c4476c
SSL_set_session() before or because the same B<ssl> was already used for
Packit c4476c
a connection), SSL_SESSION_free() will be called for that session. If that old
Packit c4476c
session is still B<open>, it is considered bad and will be removed from the
Packit c4476c
session cache (if used). A session is considered open, if L<SSL_shutdown(3)> was
Packit c4476c
not called for the connection (or at least L<SSL_set_shutdown(3)> was used to
Packit c4476c
set the SSL_SENT_SHUTDOWN state).
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
SSL_SESSION objects keep internal link information about the session cache
Packit c4476c
list, when being inserted into one SSL_CTX object's session cache.
Packit c4476c
One SSL_SESSION object, regardless of its reference count, must therefore
Packit c4476c
only be used with one SSL_CTX object (and the SSL objects created
Packit c4476c
from this SSL_CTX object).
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
The following return values can occur:
Packit c4476c
Packit c4476c
=over 4
Packit c4476c
Packit c4476c
=item Z<>0
Packit c4476c
Packit c4476c
The operation failed; check the error stack to find out the reason.
Packit c4476c
Packit c4476c
=item Z<>1
Packit c4476c
Packit c4476c
The operation succeeded.
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<ssl(7)>, L<SSL_SESSION_free(3)>,
Packit c4476c
L<SSL_get_session(3)>,
Packit c4476c
L<SSL_session_reused(3)>,
Packit c4476c
L<SSL_CTX_set_session_cache_mode(3)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut