SSL_want.pod revision 160815
1281681Srpaulo=pod
2281681Srpaulo
3281681Srpaulo=head1 NAME
4281681Srpaulo
5281681SrpauloSSL_want, SSL_want_nothing, SSL_want_read, SSL_want_write, SSL_want_x509_lookup - obtain state information TLS/SSL I/O operation
6281681Srpaulo
7281681Srpaulo=head1 SYNOPSIS
8281681Srpaulo
9281681Srpaulo #include <openssl/ssl.h>
10281681Srpaulo
11281681Srpaulo int SSL_want(const SSL *ssl);
12281681Srpaulo int SSL_want_nothing(const SSL *ssl);
13281681Srpaulo int SSL_want_read(const SSL *ssl);
14281681Srpaulo int SSL_want_write(const SSL *ssl);
15281681Srpaulo int SSL_want_x509_lookup(const SSL *ssl);
16281681Srpaulo
17281681Srpaulo=head1 DESCRIPTION
18281681Srpaulo
19281681SrpauloSSL_want() returns state information for the SSL object B<ssl>.
20281681Srpaulo
21281681SrpauloThe other SSL_want_*() calls are shortcuts for the possible states returned
22281681Srpauloby SSL_want().
23281681Srpaulo
24281681Srpaulo=head1 NOTES
25281681Srpaulo
26281681SrpauloSSL_want() examines the internal state information of the SSL object. Its
27281681Srpauloreturn values are similar to that of L<SSL_get_error(3)|SSL_get_error(3)>.
28281681SrpauloUnlike L<SSL_get_error(3)|SSL_get_error(3)>, which also evaluates the
29281681Srpauloerror queue, the results are obtained by examining an internal state flag
30281681Srpauloonly. The information must therefore only be used for normal operation under
31non-blocking I/O. Error conditions are not handled and must be treated
32using L<SSL_get_error(3)|SSL_get_error(3)>.
33
34The result returned by SSL_want() should always be consistent with
35the result of L<SSL_get_error(3)|SSL_get_error(3)>.
36
37=head1 RETURN VALUES
38
39The following return values can currently occur for SSL_want():
40
41=over 4
42
43=item SSL_NOTHING
44
45There is no data to be written or to be read.
46
47=item SSL_WRITING
48
49There are data in the SSL buffer that must be written to the underlying
50B<BIO> layer in order to complete the actual SSL_*() operation.
51A call to L<SSL_get_error(3)|SSL_get_error(3)> should return
52SSL_ERROR_WANT_WRITE.
53
54=item SSL_READING
55
56More data must be read from the underlying B<BIO> layer in order to
57complete the actual SSL_*() operation.
58A call to L<SSL_get_error(3)|SSL_get_error(3)> should return
59SSL_ERROR_WANT_READ.
60
61=item SSL_X509_LOOKUP
62
63The operation did not complete because an application callback set by
64SSL_CTX_set_client_cert_cb() has asked to be called again.
65A call to L<SSL_get_error(3)|SSL_get_error(3)> should return
66SSL_ERROR_WANT_X509_LOOKUP.
67
68=back
69
70SSL_want_nothing(), SSL_want_read(), SSL_want_write(), SSL_want_x509_lookup()
71return 1, when the corresponding condition is true or 0 otherwise.
72
73=head1 SEE ALSO
74
75L<ssl(3)|ssl(3)>, L<err(3)|err(3)>, L<SSL_get_error(3)|SSL_get_error(3)>
76
77=cut
78