SSL_CTX_SET_QUIET_SHUTDOWN(3ossl)

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

πŸ’… SSL_CTX_SET_QUIET_SHUTDOWN (3ossl) ✨

okay bestie, welcome to the 3ossl manual page β€” yes that's the OpenSSL girlies, we're in their house 🫢. This one is about the four little functions that let you say "shhh 🀫" when an SSL connection is closing out. Let's go.


🌸 NAME 🌸

SSL_CTX_set_quiet_shutdown, SSL_CTX_get_quiet_shutdown, SSL_set_quiet_shutdown, SSL_get_quiet_shutdown β€” literally the whole squad that lets you manipulate shutdown behaviour πŸ’…


✨ SYNOPSIS ✨

#include <openssl/ssl.h>

void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode);
int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);

void SSL_set_quiet_shutdown(SSL *ssl, int mode);
int SSL_get_quiet_shutdown(const SSL *ssl);

πŸŽ€ DESCRIPTION πŸŽ€

So here's the tea β˜• on each of these:

  • SSL_CTX_set_quiet_shutdown() β€” sets the "quiet shutdown" flag for ctx to whatever mode you pass. And the way inheritance works? Any SSL objects created from ctx inherit the mode that was valid at the exact moment SSL_new(3) got called, no cap 🧚. mode may be 0 or 1, that's it, that's the whole menu.
  • SSL_CTX_get_quiet_shutdown() β€” returns the "quiet shutdown" setting of ctx. Reading the vibe check of your context, basically πŸ‘‘
  • SSL_set_quiet_shutdown() β€” sets the "quiet shutdown" flag for ssl to mode. This setting stays valid until ssl is removed with SSL_free(3) or until you call SSL_set_quiet_shutdown() again. And bestie, important: it is not changed when SSL_clear(3) is called 🚨. mode may be 0 or 1.
  • SSL_get_quiet_shutdown() β€” returns the "quiet shutdown" setting of ssl. Iconic, simple, useful.
⚠️ Heads up! These functions are not supported for QUIC SSL objects. And SSL_set_quiet_shutdown() has no effect if you call it on a QUIC SSL object. Like, it just does nothing. Don't come for me, that's just how it is πŸ’€

πŸ”₯ NOTES πŸ”₯

Normally, when an SSL connection is finished, the parties must send out close_notify alert messages using SSL_shutdown(3) for a clean shutdown. That's the polite, standard-compliant way to say goodbye πŸ‘‹βœ¨

But when you set the "quiet shutdown" flag to 1, SSL_shutdown(3) will set the internal flags to SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN. (Which means SSL_shutdown(3) then behaves like SSL_set_shutdown(3) called with SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN.) So the session is considered to be shutdown, but no close_notify alert is sent to the peer. πŸ‘€

🚨 And this is the part where I have to be dramatic: this behaviour violates the TLS standard. For real for real. It's giving "skipping the goodbye text and just ghosting" πŸ‘» β€” technically a shutdown, socially a crime.

The default is normal shutdown behaviour as described by the TLS standard. So if you don't touch anything, you're being a well-behaved TLS citizen 🌈


πŸ’– RETURN VALUES πŸ’–

  • SSL_CTX_set_quiet_shutdown() and SSL_set_quiet_shutdown() do not return diagnostic information. They're setters, they just do the thing, no receipts 🧾❌
  • SSL_CTX_get_quiet_shutdown() and SSL_get_quiet_shutdown() return the current setting. 0 or 1, take it or leave it ✌️

πŸ¦‹ SEE ALSO πŸ¦‹

ssl(7), SSL_shutdown(3), SSL_set_shutdown(3), SSL_new(3), SSL_clear(3), SSL_free(3) β€” go read these, they're the friend group of this page, iykyk πŸ’œ


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>.


okay that's the whole page bestie, go forth and shut down quietly (responsibly, per the TLS standard, please) πŸŒΈπŸ’…βœ¨

with love, from the 3.5.0 girlies πŸ’– β€” dated 2026-09-25, signed SSL_CTX_SET_QUIET_SHUTDOWN(3ossl), mwah 😘

πŸ“¦ where this page comes from