SSL_GET_STATE(3)
π SSL_GET_STATE(3) π
okay so bestie, this is the Library Functions Manual page for SSL_GET_STATE(3), and we are about to inspect the SSL state machine like it's a group chat with read receipts. no cap, it's giving tiny state-flag energy. π«Ά
β¨ NAME β¨
SSL_get_state, SSL_state, SSL_in_accept_init, SSL_in_before, SSL_in_connect_init, SSL_in_init, SSL_is_init_finished β inspect the state of the SSL state machine π
π SYNOPSIS π
library βlibsslβ libcrypto #include <openssl/ssl.h>
int
SSL_get_state(const SSL *ssl);
int
SSL_state(const SSL *ssl);
int
SSL_in_accept_init(const SSL *ssl);
int
SSL_in_before(const SSL *ssl);
int
SSL_in_connect_init(const SSL *ssl);
int
SSL_in_init(const SSL *ssl);
int
SSL_is_init_finished(const SSL *ssl);
πΈ DESCRIPTION πΈ
SSL_get_state() returns an encoded representation of the current state of the SSL state machine. SSL_state() is a deprecated alias for SSL_get_state() β like, she still works, but she's not the moment anymore, bestie. π
the bits that may be set π
SSL_ST_ACCEPTβ this bit is set bySSL_accept(3)and bySSL_set_accept_state(3). It indicates thatsslis set up for server mode and no client initiated the TLS handshake yet. The functionSSL_in_accept_init()returns non-zero if this bit is set or0otherwise. π₯οΈSSL_ST_BEFOREβ this bit is set by theSSL_accept(3),SSL_connect(3),SSL_set_accept_state(3), andSSL_set_connect_state(3)functions. It indicates that the TLS handshake was not initiated yet. The functionSSL_in_before()returns non-zero if this bit is set or0otherwise. β³SSL_ST_CONNECTβ this bit is set bySSL_connect(3)and bySSL_set_connect_state(3). It indicates thatsslis set up for client mode and no TLS handshake was initiated yet. The functionSSL_in_connect_init()returns non-zero if this bit is set or0otherwise. π
the masks that can be used π
SSL_ST_INITβ set ifSSL_ST_ACCEPTorSSL_ST_CONNECTis set. The functionSSL_in_init()returns a non-zero value if one of these is set or0otherwise. β¨SSL_ST_MASKβ this mask includes all bits exceptSSL_ST_ACCEPT,SSL_ST_BEFORE, andSSL_ST_CONNECT. π«£SSL_ST_OKβ the state is set to this value when a connection is established. The functionSSL_is_init_finished()returns a non-zero value if the state equals this constant, or0otherwise. βSSL_ST_RENEGOTIATEβ the program is about to renegotiate, for example when enteringSSL_read(3)orSSL_write(3)right afterSSL_renegotiate(3)was called. π
The meaning of other bits is protocol-dependent. Application programs usually do not need to inspect any of those other bits. fr fr, you can leave those alone.
All these functions may be implemented as macros. iykyk.
π¦ SEE ALSO π¦
π HISTORY π
SSL_is_init_finished()first appeared in SSLeay 0.4.5b.SSL_state()first appeared in SSLeay 0.5.2.SSL_in_accept_init(),SSL_in_connect_init(), andSSL_in_init()first appeared in SSLeay 0.6.0.SSL_in_before()first appeared in SSLeay 0.8.0.SSL_get_state()first appeared in SSLeay 0.9.0.- All these functions have been available since OpenBSD 2.4.
xoxo bestie π β Debian β June 8, 2025 β SSL_GET_STATE(3)
π¦ 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) 2016 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms