SSL_RSTATE_STRING(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸ’… SSL_RSTATE_STRING(3ossl) β€” like, the read-state vibe check ✨

okay bestie, so we're in the 3ossl manual section and this page is literally all about SSL_rstate_string, SSL_rstate_string_long β€” getting a textual description of the state of an SSL object during a read operation πŸŽ€


🌸 NAME 🌸

SSL_rstate_string, SSL_rstate_string_long β€” get textual description of state of an SSL object during read operation. no cap, that's the whole job 🫢


✨ SYNOPSIS ✨

#include <openssl/ssl.h>

const char *SSL_rstate_string(SSL *ssl);
const char *SSL_rstate_string_long(SSL *ssl);

periodt. that's the entire API surface, she's small but she's iconic πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So SSL_rstate_string() returns a 2 letter string indicating the current read state of the SSL object ssl. two letters. that's it. tiny. adorable. πŸ“

And SSL_rstate_string_long() returns a string indicating the current read state of the SSL object ssl β€” same tea, just spelled out in full words instead of the two-letter abbreviation. main character energy, honestly πŸ‘‘


🧚 NOTES 🧚

okay so here's the lore: when performing a read operation, the SSL/TLS engine must parse the record, consisting of header and body. literally header then body, in that order, no skipping πŸ’€

And when you're working in a blocking environment, SSL_rstate_string[_long]() should always return "RD"/"read done". always. like clockwork. if it doesn't, something's giving weird 😭

real talk though: this function should only seldom be needed in applications. she's a rare guest, not your everyday bestie πŸ™ˆ

πŸ’– RETURN VALUES πŸ’–

SSL_rstate_string() and SSL_rstate_string_long() can return the following values:

  • "RH"/"read header" β€” the header of the record is being evaluated. we're in our header era πŸ”₯
  • "RB"/"read body" β€” the body of the record is being evaluated. body positivity, but for records ✨
  • "unknown"/"unknown" β€” the read state is unknown. this should never happen. like literally never, if you see this, something went off the rails πŸ’€

Also, when used with QUIC SSL objects, these functions always return "RH"/"read header" in normal conditions. QUIC stays in its header era permanently, ig 🌈


⭐ SEE ALSO ⭐

  • ssl(7) β€” go read it, iykwim 🫢

Copyright 2001-2023 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 page, bestie πŸŽ€ version 3.5.0, dated 2026-09-25 β€” mwah, slay, go forth and read your records πŸ’œ

πŸ“¦ where this page comes from