Blame doc/man3/SSL_clear.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SSL_clear - reset SSL object to allow another connection
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ssl.h>
Packit c4476c
Packit c4476c
 int SSL_clear(SSL *ssl);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
Reset B<ssl> to allow another connection. All settings (method, ciphers,
Packit c4476c
BIOs) are kept.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
SSL_clear is used to prepare an SSL object for a new connection. While all
Packit c4476c
settings are kept, a side effect is the handling of the current SSL session.
Packit c4476c
If a session is still B<open>, it is considered bad and will be removed
Packit c4476c
from the session cache, as required by RFC2246. A session is considered open,
Packit c4476c
if L<SSL_shutdown(3)> was not called for the connection
Packit c4476c
or at least L<SSL_set_shutdown(3)> was used to
Packit c4476c
set the SSL_SENT_SHUTDOWN state.
Packit c4476c
Packit c4476c
If a session was closed cleanly, the session object will be kept and all
Packit c4476c
settings corresponding. This explicitly means, that e.g. the special method
Packit c4476c
used during the session will be kept for the next handshake. So if the
Packit c4476c
session was a TLSv1 session, a SSL client object will use a TLSv1 client
Packit c4476c
method for the next handshake and a SSL server object will use a TLSv1
Packit c4476c
server method, even if TLS_*_methods were chosen on startup. This
Packit c4476c
will might lead to connection failures (see L<SSL_new(3)>)
Packit c4476c
for a description of the method's properties.
Packit c4476c
Packit c4476c
=head1 WARNINGS
Packit c4476c
Packit c4476c
SSL_clear() resets the SSL object to allow for another connection. The
Packit c4476c
reset operation however keeps several settings of the last sessions
Packit c4476c
(some of these settings were made automatically during the last
Packit c4476c
handshake). It only makes sense for a new connection with the exact
Packit c4476c
same peer that shares these settings, and may fail if that peer
Packit c4476c
changes its settings between connections. Use the sequence
Packit c4476c
L<SSL_get_session(3)>;
Packit c4476c
L<SSL_new(3)>;
Packit c4476c
L<SSL_set_session(3)>;
Packit c4476c
L<SSL_free(3)>
Packit c4476c
instead to avoid such failures
Packit c4476c
(or simply L<SSL_free(3)>; L<SSL_new(3)>
Packit c4476c
if session reuse is not desired).
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 SSL_clear() operation could not be performed. Check the error stack to
Packit c4476c
find out the reason.
Packit c4476c
Packit c4476c
=item Z<>1
Packit c4476c
Packit c4476c
The SSL_clear() operation was successful.
Packit c4476c
Packit c4476c
=back
Packit c4476c
Packit c4476c
L<SSL_new(3)>, L<SSL_free(3)>,
Packit c4476c
L<SSL_shutdown(3)>, L<SSL_set_shutdown(3)>,
Packit c4476c
L<SSL_CTX_set_options(3)>, L<ssl(7)>,
Packit c4476c
L<SSL_CTX_set_client_cert_cb(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