
#use wml::openssl-macros area=docs page=SSL_want

<title>Documents, SSL_want(3)</title>

<h1>SSL_want(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
SSL_want, SSL_want_nothing, SSL_want_read, SSL_want_write,
SSL_want_x509_lookup - obtain state information TLS/SSL I/O operation

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/ssl.h&gt;
</PRE>
<PRE> int SSL_want(const SSL *ssl);
 int SSL_want_nothing(const SSL *ssl);
 int SSL_want_read(const SSL *ssl);
 int SSL_want_write(const SSL *ssl);
 int SSL_want_x509_lookup(const SSL *ssl);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>SSL_want()</CODE> returns state information for the SSL object <STRONG>ssl</STRONG>.

</P>
<P>
The other SSL_want_*() calls are shortcuts for the possible states returned
by <CODE>SSL_want().</CODE>

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
<CODE>SSL_want()</CODE> examines the internal state information of the SSL
object. Its return values are similar to that of <A HREF="../ssl/SSL_get_error.html#">SSL_get_error(3)</A>. Unlike <A HREF="../ssl/SSL_get_error.html#">SSL_get_error(3)</A>, which also evaluates the error queue, the results are obtained by
examining an internal state flag only. The information must therefore only
be used for normal operation under non-blocking I/O. Error conditions are
not handled and must be treated using <A HREF="../ssl/SSL_get_error.html#">SSL_get_error(3)</A>.

</P>
<P>
The result returned by <CODE>SSL_want()</CODE> should always be consistent
with the result of <A HREF="../ssl/SSL_get_error.html#">SSL_get_error(3)</A>.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
The following return values can currently occur for
<CODE>SSL_want():</CODE>

</P>
<DL>
<DT><STRONG><A NAME="item_SSL_NOTHING">SSL_NOTHING</A></STRONG><DD>
<P>
There is no data to be written or to be read.

</P>
<DT><STRONG><A NAME="item_SSL_WRITING">SSL_WRITING</A></STRONG><DD>
<P>
There are data in the SSL buffer that must be written to the underlying
<STRONG>BIO</STRONG> layer in order to complete the actual SSL_*() operation. A call to <A HREF="../ssl/SSL_get_error.html#">SSL_get_error(3)</A> should return SSL_ERROR_WANT_WRITE.

</P>
<DT><STRONG><A NAME="item_SSL_READING">SSL_READING</A></STRONG><DD>
<P>
More data must be read from the underlying <STRONG>BIO</STRONG> layer in order to complete the actual SSL_*() operation. A call to <A HREF="../ssl/SSL_get_error.html#">SSL_get_error(3)</A> should return SSL_ERROR_WANT_READ.

</P>
<DT><STRONG><A NAME="item_SSL_X509_LOOKUP">SSL_X509_LOOKUP</A></STRONG><DD>
<P>
The operation did not complete because an application callback set by
<CODE>SSL_CTX_set_client_cert_cb()</CODE> has asked to be called again. A
call to <A HREF="../ssl/SSL_get_error.html#">SSL_get_error(3)</A> should return SSL_ERROR_WANT_X509_LOOKUP.

</P>
</DL>
<P>
<CODE>SSL_want_nothing(),</CODE> <CODE>SSL_want_read(),</CODE>
<CODE>SSL_want_write(),</CODE> <CODE>SSL_want_x509_lookup()</CODE> return
1, when the corresponding condition is true or 0 otherwise.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../ssl/ssl.html#">ssl(3)</A>, <A HREF="../crypto/err.html#">err(3)</A>, <A HREF="../ssl/SSL_get_error.html#">SSL_get_error(3)</A>



</P>
:}


