]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/SSL_want.pod
Restore sensible "sess_accept" counter tracking
[thirdparty/openssl.git] / doc / man3 / SSL_want.pod
CommitLineData
c1497b4d
LJ
1=pod
2
3=head1 NAME
4
fc7f190c 5SSL_want, SSL_want_nothing, SSL_want_read, SSL_want_write, SSL_want_x509_lookup,
a9c0d8be
DB
6SSL_want_async, SSL_want_async_job, SSL_want_client_hello_cb - obtain state
7information TLS/SSL I/O operation
c1497b4d
LJ
8
9=head1 SYNOPSIS
10
11 #include <openssl/ssl.h>
12
c3e64028
NL
13 int SSL_want(const SSL *ssl);
14 int SSL_want_nothing(const SSL *ssl);
15 int SSL_want_read(const SSL *ssl);
16 int SSL_want_write(const SSL *ssl);
17 int SSL_want_x509_lookup(const SSL *ssl);
fc7f190c
MC
18 int SSL_want_async(const SSL *ssl);
19 int SSL_want_async_job(const SSL *ssl);
a9c0d8be 20 int SSL_want_client_hello_cb(const SSL *ssl);
c1497b4d
LJ
21
22=head1 DESCRIPTION
23
24SSL_want() returns state information for the SSL object B<ssl>.
25
26The other SSL_want_*() calls are shortcuts for the possible states returned
27by SSL_want().
28
29=head1 NOTES
30
31SSL_want() examines the internal state information of the SSL object. Its
9b86974e
RS
32return values are similar to that of L<SSL_get_error(3)>.
33Unlike L<SSL_get_error(3)>, which also evaluates the
c1497b4d
LJ
34error queue, the results are obtained by examining an internal state flag
35only. The information must therefore only be used for normal operation under
36non-blocking I/O. Error conditions are not handled and must be treated
9b86974e 37using L<SSL_get_error(3)>.
c1497b4d
LJ
38
39The result returned by SSL_want() should always be consistent with
9b86974e 40the result of L<SSL_get_error(3)>.
c1497b4d
LJ
41
42=head1 RETURN VALUES
43
44The following return values can currently occur for SSL_want():
45
46=over 4
47
48=item SSL_NOTHING
49
50There is no data to be written or to be read.
51
52=item SSL_WRITING
53
54There are data in the SSL buffer that must be written to the underlying
55B<BIO> layer in order to complete the actual SSL_*() operation.
9b86974e 56A call to L<SSL_get_error(3)> should return
c1497b4d
LJ
57SSL_ERROR_WANT_WRITE.
58
59=item SSL_READING
60
61More data must be read from the underlying B<BIO> layer in order to
62complete the actual SSL_*() operation.
9b86974e 63A call to L<SSL_get_error(3)> should return
c1497b4d
LJ
64SSL_ERROR_WANT_READ.
65
66=item SSL_X509_LOOKUP
67
68The operation did not complete because an application callback set by
69SSL_CTX_set_client_cert_cb() has asked to be called again.
9b86974e 70A call to L<SSL_get_error(3)> should return
c1497b4d
LJ
71SSL_ERROR_WANT_X509_LOOKUP.
72
fc7f190c
MC
73=item SSL_ASYNC_PAUSED
74
75An asynchronous operation partially completed and was then paused. See
76L<SSL_get_all_async_fds(3)>. A call to L<SSL_get_error(3)> should return
77SSL_ERROR_WANT_ASYNC.
78
79=item SSL_ASYNC_NO_JOBS
80
81The asynchronous job could not be started because there were no async jobs
82available in the pool (see ASYNC_init_thread(3)). A call to L<SSL_get_error(3)>
83should return SSL_ERROR_WANT_ASYNC_JOB.
84
a9c0d8be 85=item SSL_CLIENT_HELLO_CB
6b1bb98f
BK
86
87The operation did not complete because an application callback set by
a9c0d8be 88SSL_CTX_set_client_hello_cb() has asked to be called again.
6b1bb98f 89A call to L<SSL_get_error(3)> should return
a9c0d8be 90SSL_ERROR_WANT_CLIENT_HELLO_CB.
6b1bb98f 91
c1497b4d
LJ
92=back
93
fc7f190c 94SSL_want_nothing(), SSL_want_read(), SSL_want_write(), SSL_want_x509_lookup(),
a9c0d8be
DB
95SSL_want_async(), SSL_want_async_job(), and SSL_want_client_hello_cb() return
961, when the corresponding condition is true or 0 otherwise.
c1497b4d
LJ
97
98=head1 SEE ALSO
99
73fb82b7 100L<ssl(7)>, L<SSL_get_error(3)>
c1497b4d 101
6b1bb98f
BK
102=head1 HISTORY
103
a9c0d8be 104SSL_want_client_hello_cb() and SSL_CLIENT_HELLO_CB were added in OpenSSL 1.1.1.
6b1bb98f 105
e2f92610
RS
106=head1 COPYRIGHT
107
6b1bb98f 108Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
e2f92610
RS
109
110Licensed under the OpenSSL license (the "License"). You may not use
111this file except in compliance with the License. You can obtain a copy
112in the file LICENSE in the source distribution or at
113L<https://www.openssl.org/source/license.html>.
114
115=cut