---
name: "libressl-SSL_want"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-SSL_want"
---

# libressl-SSL\_want(3)

obtain state information TLS/SSL I/O operation

## NAME

**SSL\_want**, **SSL\_want\_nothing**, **SSL\_want\_read**, **SSL\_want\_write**, **SSL\_want\_x509\_lookup** – obtain state information TLS/SSL I/O operation

## SYNOPSIS

SSL Library (libssl, -lssl) libcrypto

**#include \<openssl/ssl.h\>**

*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*);

## DESCRIPTION

**SSL\_want**() returns state information for the *SSL* object *ssl*.

The other **SSL\_want\_\***() calls are shortcuts for the possible states returned by **SSL\_want**().

**SSL\_want**() examines the internal state information of the *SSL* object. Its return values are similar to those of SSL\_get\_error(3). Unlike SSL\_get\_error(3), 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 SSL\_get\_error(3).

The result returned by **SSL\_want**() should always be consistent with the result of SSL\_get\_error(3).

## RETURN VALUES

The following return values can currently occur for **SSL\_want**():

- SSL\_NOTHING

  There is no data to be written or to be read.

- SSL\_WRITING

  There are data in the SSL buffer that must be written to the underlying *BIO* layer in order to complete the actual **SSL\_\***() operation. A call to SSL\_get\_error(3) should return SSL\_ERROR\_WANT\_WRITE.

- SSL\_READING

  More data must be read from the underlying *BIO* layer in order to complete the actual **SSL\_\***() operation. A call to SSL\_get\_error(3) should return SSL\_ERROR\_WANT\_READ.

- SSL\_X509\_LOOKUP

  The operation did not complete because an application callback set by SSL\_CTX\_set\_client\_cert\_cb(3) has asked to be called again. A call to SSL\_get\_error(3) should return SSL\_ERROR\_WANT\_X509\_LOOKUP.

**SSL\_want\_nothing**(), **SSL\_want\_read**(), **SSL\_want\_write**(), and **SSL\_want\_x509\_lookup**() return 1 when the corresponding condition is true or 0 otherwise.

## SEE ALSO

[err(3)](/err/3.md), [ssl(3)](/ssl/3.md), SSL\_get\_error(3)

## HISTORY

**SSL\_want**(), **SSL\_want\_nothing**(), **SSL\_want\_read**(), and **SSL\_want\_write**() first appeared in SSLeay 0.5.2. **SSL\_want\_x509\_lookup**() first appeared in SSLeay 0.6.0. These functions have been available since OpenBSD 2.4.
