SSL_WANT(3)
πΈ NAME πΈ
okay so welcome to SSL_WANT(3), bestie β this is the Library Functions Manual page for the little crew of functions that obtain state information about a TLS/SSL I/O operation. The squad is:
SSL_want,SSL_want_nothing,SSL_want_read,SSL_want_write,SSL_want_x509_lookupβ obtain state information about a TLS/SSL I/O operation. yes, all of them, and theyβre all about that state-info life. π
β¨ SYNOPSIS β¨
library βlibsslβ 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 π
okay so SSL_want() returns state information for the SSL object ssl. thatβs the main character of this whole page. β¨
The other SSL_want_*() calls are shortcuts for the possible states returned by SSL_want(). lowkey just convenience wrappers, highkey the same info. π«Ά
SSL_want() examines the internal state information of the SSL object. Its return values are similar to those of SSL_get_error(3). but bestie, the way it gets them is different: unlike SSL_get_error(3), which also evaluates the error queue, the results are obtained by examining an internal state flag only. so 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). do not try to make SSL_want() do error-queue detective work, because it will not. π
The result returned by SSL_want() should always be consistent with the result of SSL_get_error(3). periodt. consistency is the moment. π
π₯ 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. literally nothing on the I/O agenda. πSSL_WRITINGβ there are data in the SSL buffer that must be written to the underlying BIO layer in order to complete the actualSSL_*()operation. A call toSSL_get_error(3)should returnSSL_ERROR_WANT_WRITE. itβs giving βwrite me to the BIO layer so we can finishβ energy. βοΈSSL_READINGβ more data must be read from the underlying BIO layer in order to complete the actualSSL_*()operation. A call toSSL_get_error(3)should returnSSL_ERROR_WANT_READ. read era, no cap. πSSL_X509_LOOKUPβ the operation did not complete because an application callback set bySSL_CTX_set_client_cert_cb(3)has asked to be called again. A call toSSL_get_error(3)should returnSSL_ERROR_WANT_X509_LOOKUP. callback said βrun me back,β and honestly? iconic. π
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. simple as that. π―
π¦ SEE ALSO π¦
Go be nosy, bestie: err(3), ssl(3), SSL_get_error(3). all the related lore is right there. π
π HISTORY π
history lesson but make it cute: 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. so theyβve been around for a minute. β
mwah π β this page comes from Debian, dated June 8, 2025. now go handle your non-blocking I/O, bestie π«Άβ¨
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2001, 2005 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms