SSL_RSTATE_STRING(3SSL)

πŸ’– SSL_RSTATE_STRING πŸ’–

okay bestie, welcome to the manual page for SSL_rstate_string and SSL_rstate_string_long β€” two lil functions from the OpenSSL zone (that's the 3SSL manual, if you're keeping track) that tell you what your SSL object is doing while it's reading. cute, right? let's get into it πŸ¦‹


✨ NAME ✨

SSL_rstate_string, SSL_rstate_string_long β€” get a textual description of the state of an SSL object during a read operation πŸ’…


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

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

πŸŽ€ DESCRIPTION πŸŽ€

so SSL_rstate_string() returns a 2 letter string that tells you the current read state of the SSL object ssl. short and iconic. 🫢

and SSL_rstate_string_long() returns a string indicating the current read state of the SSL object ssl. same energy, just with the words spelled all the way out. the long version ate, ngl.


πŸ’€ NOTES πŸ’€

when you're doing a read operation, the SSL/TLS engine has to parse the record β€” and a record is made up of a header and a body. the way that works is lowkey important to know.

when you're working in a blocking environment, SSL_rstate_string[_long]() should always return "RD"/"read done". always. no cap.

this function should only seldom be needed in applications. like, it's not the main character here, it's more of a background cameo. πŸ™ˆ

🌈 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. it's giving header era. πŸ“–
  • "RB"/"read body" β€” the body of the record is being evaluated. it's giving body era. πŸ’ƒ
  • "unknown"/"unknown" β€” the read state is unknown. this should never happen. like literally never. if you see this, something is deeply unwell. 😭

when used with QUIC SSL objects, these functions always return "RH"/"read header" in normal conditions. periodt.


πŸ‘‘ SEE ALSO πŸ‘‘

ssl(7)


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 whole page, bestie πŸ’– this was SSL_RSTATE_STRING(3SSL), version 4.0.3, dated 2026-09-29. slay, go read your records, ily πŸŽ€βœ¨

πŸ“¦ where this page comes from