SSL_GET_STATE(3)
π SSL_GET_STATE(3) π
(from the Library Functions Manual, bestie β yes, thatβs the manual-name vibe β¨)
β¨ NAME β¨
SSL_get_state, SSL_state, SSL_in_accept_init, SSL_in_before, SSL_in_connect_init, SSL_in_init, SSL_is_init_finished β these are the functions that inspect the state of the SSL state machine. no cap π
π SYNOPSIS π
#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 π¦
okay so 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() β deprecated, bestie, so maybe donβt make it your main character.
The following bits 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 following masks 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.
All these functions may be implemented as macros. so donβt be shocked if theyβre macros under the hood β iykyk π
πΈ SEE ALSO πΈ
π HISTORY π
SSL_is_init_finished()first appeared in SSLeay0.4.5b.SSL_state()first appeared in SSLeay0.5.2.SSL_in_accept_init(),SSL_in_connect_init(), andSSL_in_init()first appeared in SSLeay0.6.0.SSL_in_before()first appeared in SSLeay0.8.0.SSL_get_state()first appeared in SSLeay0.9.0.- All these functions have been available since OpenBSD
2.4.
mwah π this page is the Debian version, dated June 12, 2019, and itβs filed under SSL_GET_STATE(3). periodt. π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: libressl-devel-doc 4.1.0-bp160.1.1 Β· 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