SSL_STATE_STRING(3SSL)
π SSL_STATE_STRING β bestie, let's read the vibes of your SSL object π
okay so this is a page from the OpenSSL manuals, section 3SSL (library calls, bestie, not a command you type in your shell π). Two little functions, one big job: telling you what state your SSL object is in right now. That's it. That's the whole gig. β¨
πΈ NAME πΈ
SSL_state_string, SSL_state_string_long β get a textual description of the state of an SSL object π¦
π SYNOPSIS π
#include <openssl/ssl.h>
const char *SSL_state_string(const SSL *ssl);
const char *SSL_state_string_long(const SSL *ssl);
β¨ DESCRIPTION β¨
SSL_state_string()β returns an abbreviated string showing the current state of the SSL objectssl. And when we say abbreviated, we mean it β the returned NUL-terminated string is6characters or fewer. Tiny. Compact. It's giving β¨minimalismβ¨, it's giving sticker energy πSSL_state_string_long()β returns a descriptive string showing the current state of the SSL objectssl. Same state, but now it's the main character and it has things to say π
Both hand you back a NUL-terminated string, both take a const SSL *ssl. That's the whole signature, no notes. π
π§ NOTES π§
During its life, an SSL object passes through several states. The state is maintained internally β you don't set it, you just peek at it, like checking someone's status without reacting. π
ngl, querying the state info is not very informative before a connection has been established, or at the moment one is being established. But during the handshake?? That's when it gets interesting. That's the moment. Obsessed, fr fr. π₯
So here's the tea with nonblocking sockets π«: when you're using them, the function call doing the handshake may return with a SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE condition β and that's exactly the window where SSL_state_string[_long]() may be called. Perfect little opportunity, no cap. π
And for both blocking and nonblocking sockets: you can use that detailed state information inside the info_callback function that you set with the SSL_set_info_callback() call. iykyk. β¨
π RETURN VALUES π
Detailed description of possible states to be included later.
(yeah bestie, we know. it's coming. the states will be documented eventually. we simply must be patient, periodt. π)
π¦ SEE ALSO π¦
ssl(7), SSL_CTX_set_info_callback(3)
π COPYRIGHT π
Copyright 2001-2021 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>.
and that's the whole page, bestie!! π«Ά this one shipped as version 4.0.3, dated 2026-09-29, and that's the SSL_STATE_STRING era of the OpenSSL manual β go forth and check those handshake states, you absolute icon βπΈ
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms