SSL_SET_SHUTDOWN(3)
π SSL_set_shutdown, SSL_get_shutdown π
okay so this is the SSL_SET_SHUTDOWN(3) page from the libssl / libcrypto manual, and weβre about to make shutdown state make sense, bestie. π
π NAME π
SSL_set_shutdown, SSL_get_shutdown β manipulate shutdown state of an SSL connection.
β¨ SYNOPSIS β¨
these are the exact signatures, no cap:
library βlibsslβ libcrypto #include <openssl/ssl.h>
void
SSL_set_shutdown(SSL *ssl, int mode);
int
SSL_get_shutdown(const SSL *ssl);
π DESCRIPTION π
SSL_set_shutdown() sets the shutdown state of ssl to mode.
SSL_get_shutdown() returns the shutdown mode of ssl.
The shutdown state of an ssl connection is a bitmask of:
0β no shutdown setting, yet.SSL_SENT_SHUTDOWNβ a βclose notifyβ shutdown alert was sent to the peer; the connection is being considered closed and the session is closed and correct.SSL_RECEIVED_SHUTDOWNβ a shutdown alert was received from the peer, either a normal βclose notifyβ or a fatal error.
SSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time.
The shutdown state of the connection is used to determine the state of the ssl session. If the session is still open when SSL_clear(3) or SSL_free(3) is called, it is considered bad and removed according to RFC 2246. The actual condition for a correctly closed session is SSL_SENT_SHUTDOWN (according to the TLS RFC, it is acceptable to only send the βclose notifyβ alert but to not wait for the peer's answer when the underlying connection is closed). SSL_set_shutdown() can be used to set this state without sending a close alert to the peer (see SSL_shutdown(3)).
If a βclose notifyβ was received, SSL_RECEIVED_SHUTDOWN will be set, but to set SSL_SENT_SHUTDOWN the application must still call SSL_shutdown(3) or SSL_set_shutdown() itself.
π₯ RETURN VALUES π₯
SSL_get_shutdown() returns the current setting. thatβs the whole return-values situation β short and sweet, periodt. π
π¦ SEE ALSO π¦
πΈ HISTORY πΈ
SSL_set_shutdown() and SSL_get_shutdown() first appeared in SSLeay 0.8.0 and have been available since OpenBSD 2.4.
π cute little Debian sign-off, dated June 8, 2025 β thatβs the footer, bestie, and weβre done π
π¦ 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) 2001, 2005 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms