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

# SSL\_want(3ssl)

obtain state information TLS/SSL I/O operation

## NAME

SSL\_want, SSL\_want\_nothing, SSL\_want\_read, SSL\_want\_write, SSL\_want\_x509\_lookup, SSL\_want\_retry\_verify, SSL\_want\_async, SSL\_want\_async\_job, SSL\_want\_client\_hello\_cb - obtain state information TLS/SSL I/O operation

## SYNOPSIS

```
 #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);
 int SSL_want_retry_verify(const SSL *ssl);
 int SSL_want_async(const SSL *ssl);
 int SSL_want_async_job(const SSL *ssl);
 int SSL_want_client_hello_cb(const SSL *ssl);
```

## DESCRIPTION

**SSL\_want()** returns state information for the SSL object **ssl**. **ssl** **MUST NOT** be NULL.

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

## NOTES

**SSL\_want()** examines the internal state information of the SSL object. Its return values are similar to that 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 nonblocking 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()** has asked to be called again. A call to **SSL\_get\_error**(3) should return **SSL\_ERROR\_WANT\_X509\_LOOKUP**.

- SSL\_RETRY\_VERIFY

  The operation did not complete because a certificate verification callback has asked to be called again via **SSL\_set\_retry\_verify**(3). A call to **SSL\_get\_error**(3) should return **SSL\_ERROR\_WANT\_RETRY\_VERIFY**.

- SSL\_ASYNC\_PAUSED

  An asynchronous operation partially completed and was then paused. See **SSL\_get\_all\_async\_fds**(3). A call to **SSL\_get\_error**(3) should return **SSL\_ERROR\_WANT\_ASYNC**.

- SSL\_ASYNC\_NO\_JOBS

  The asynchronous job could not be started because there were no async jobs available in the pool (see **ASYNC\_init\_thread**(3)). A call to **SSL\_get\_error**(3) should return **SSL\_ERROR\_WANT\_ASYNC\_JOB**.

- SSL\_CLIENT\_HELLO\_CB

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

**SSL\_want\_nothing()**, **SSL\_want\_read()**, **SSL\_want\_write()**, **SSL\_want\_x509\_lookup()**, **SSL\_want\_retry\_verify()**, **SSL\_want\_async()**, **SSL\_want\_async\_job()**, and **SSL\_want\_client\_hello\_cb()** return 1 when the corresponding condition is true or 0 otherwise.

## QUIC-SPECIFIC CONSIDERATIONS

For QUIC, these functions relate only to the TLS handshake layer.

## SEE ALSO

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

## HISTORY

The **SSL\_want\_client\_hello\_cb()** function and the SSL\_CLIENT\_HELLO\_CB return value were added in OpenSSL 1.1.1.

**SSL\_want\_retry\_verify()** was added in OpenSSL 3.0.

## COPYRIGHT

Copyright 2001-2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License").  You may not use this file except in compliance with the License.  You can obtain a copy in the file LICENSE in the source distribution or at \<https://www.openssl.org/source/license.html\>.
