Blame doc/man3/SSL_accept.pod

Packit Service 084de1
=pod
Packit Service 084de1
Packit Service 084de1
=head1 NAME
Packit Service 084de1
Packit Service 084de1
SSL_accept - wait for a TLS/SSL client to initiate a TLS/SSL handshake
Packit Service 084de1
Packit Service 084de1
=head1 SYNOPSIS
Packit Service 084de1
Packit Service 084de1
 #include <openssl/ssl.h>
Packit Service 084de1
Packit Service 084de1
 int SSL_accept(SSL *ssl);
Packit Service 084de1
Packit Service 084de1
=head1 DESCRIPTION
Packit Service 084de1
Packit Service 084de1
SSL_accept() waits for a TLS/SSL client to initiate the TLS/SSL handshake.
Packit Service 084de1
The communication channel must already have been set and assigned to the
Packit Service 084de1
B<ssl> by setting an underlying B<BIO>.
Packit Service 084de1
Packit Service 084de1
=head1 NOTES
Packit Service 084de1
Packit Service 084de1
The behaviour of SSL_accept() depends on the underlying BIO.
Packit Service 084de1
Packit Service 084de1
If the underlying BIO is B<blocking>, SSL_accept() will only return once the
Packit Service 084de1
handshake has been finished or an error occurred.
Packit Service 084de1
Packit Service 084de1
If the underlying BIO is B<non-blocking>, SSL_accept() will also return
Packit Service 084de1
when the underlying BIO could not satisfy the needs of SSL_accept()
Packit Service 084de1
to continue the handshake, indicating the problem by the return value -1.
Packit Service 084de1
In this case a call to SSL_get_error() with the
Packit Service 084de1
return value of SSL_accept() will yield B<SSL_ERROR_WANT_READ> or
Packit Service 084de1
B<SSL_ERROR_WANT_WRITE>. The calling process then must repeat the call after
Packit Service 084de1
taking appropriate action to satisfy the needs of SSL_accept().
Packit Service 084de1
The action depends on the underlying BIO. When using a non-blocking socket,
Packit Service 084de1
nothing is to be done, but select() can be used to check for the required
Packit Service 084de1
condition. When using a buffering BIO, like a BIO pair, data must be written
Packit Service 084de1
into or retrieved out of the BIO before being able to continue.
Packit Service 084de1
Packit Service 084de1
=head1 RETURN VALUES
Packit Service 084de1
Packit Service 084de1
The following return values can occur:
Packit Service 084de1
Packit Service 084de1
=over 4
Packit Service 084de1
Packit Service 084de1
=item Z<>0
Packit Service 084de1
Packit Service 084de1
The TLS/SSL handshake was not successful but was shut down controlled and
Packit Service 084de1
by the specifications of the TLS/SSL protocol. Call SSL_get_error() with the
Packit Service 084de1
return value B<ret> to find out the reason.
Packit Service 084de1
Packit Service 084de1
=item Z<>1
Packit Service 084de1
Packit Service 084de1
The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been
Packit Service 084de1
established.
Packit Service 084de1
Packit Service 084de1
=item E<lt>0
Packit Service 084de1
Packit Service 084de1
The TLS/SSL handshake was not successful because a fatal error occurred either
Packit Service 084de1
at the protocol level or a connection failure occurred. The shutdown was
Packit Service 084de1
not clean. It can also occur if action is needed to continue the operation
Packit Service 084de1
for non-blocking BIOs. Call SSL_get_error() with the return value B<ret>
Packit Service 084de1
to find out the reason.
Packit Service 084de1
Packit Service 084de1
=back
Packit Service 084de1
Packit Service 084de1
=head1 SEE ALSO
Packit Service 084de1
Packit Service 084de1
L<SSL_get_error(3)>, L<SSL_connect(3)>,
Packit Service 084de1
L<SSL_shutdown(3)>, L<ssl(7)>, L<bio(7)>,
Packit Service 084de1
L<SSL_set_connect_state(3)>,
Packit Service 084de1
L<SSL_do_handshake(3)>,
Packit Service 084de1
L<SSL_CTX_new(3)>
Packit Service 084de1
Packit Service 084de1
=head1 COPYRIGHT
Packit Service 084de1
Packit Service 084de1
Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
Packit Service 084de1
Packit Service 084de1
Licensed under the OpenSSL license (the "License").  You may not use
Packit Service 084de1
this file except in compliance with the License.  You can obtain a copy
Packit Service 084de1
in the file LICENSE in the source distribution or at
Packit Service 084de1
L<https://www.openssl.org/source/license.html>.
Packit Service 084de1
Packit Service 084de1
=cut