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 object ssl. And when we say abbreviated, we mean it β€” the returned NUL-terminated string is 6 characters 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 object ssl. 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 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