SSL_CTX_SET_QUIET_SHUTDOWN(3ossl)

πŸ’… SSL_CTX_SET_QUIET_SHUTDOWN β€” the OpenSSL one, bestie

okay so we're in the 3ossl girlies section of the OpenSSL manual, and today's main character is quiet shutdown. yes it's a real thing. no it's not about being shy. let's get into it πŸŽ€


✨ NAME ✨

SSL_CTX_set_quiet_shutdown, SSL_CTX_get_quiet_shutdown, SSL_set_quiet_shutdown, SSL_get_quiet_shutdown β€” these four baddies manipulate shutdown behaviour. that's the whole job. that's what they do. πŸ’–


🌸 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, bestie. there's a lil flag called the "quiet shutdown" flag and these functions are how you poke at it.

  • SSL_CTX_set_quiet_shutdown() β€” sets the "quiet shutdown" flag on ctx to be mode. and here's the inherited-behavior moment: any SSL objects you create from ctx will pick up whatever mode was valid at the time SSL_new(3) is called. so set it before you spawn, okay? mode may be 0 or 1. that's it. those are the options. πŸ‘‘
  • SSL_CTX_get_quiet_shutdown() β€” just hands you back the current "quiet shutdown" setting of ctx. a little reading, no writing. respectful. ✨
  • SSL_set_quiet_shutdown() β€” sets the "quiet shutdown" flag on ssl to be mode. and this setting stays valid until ssl gets removed with SSL_free(3), or until you call SSL_set_quiet_shutdown() again. IMPORTANT: it is not changed when SSL_clear(3) is called. like, SSL_clear(3) does not touch it. no cap. mode may be 0 or 1.
  • SSL_get_quiet_shutdown() β€” returns the current "quiet shutdown" setting of ssl. reading again. love that for us. 🫢
🚨 okay so this next bit is a whole thing: 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. so like… don't. πŸ’€

πŸ“ NOTES πŸ“

normally β€” and by normally i mean the standard, well-behaved way β€” when an SSL connection finishes, the parties must send out close_notify alert messages using SSL_shutdown(3) for a clean shutdown. that's the polite thing to do. that's the TLS standard behavior.

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) was called with SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN. 😭

so the session is considered to be shutdown, bestie β€” but no close_notify alert is sent to the peer. it just… ghosts them. and yeah, this behaviour violates the TLS standard. it's giving "i left the group chat with no explanation." so know what you're doing before you flip this on.

the default is normal shutdown behaviour, as described by the TLS standard. that's the baseline. the safe vibe. ⭐


πŸ”₯ RETURN VALUES πŸ”₯

  • SSL_CTX_set_quiet_shutdown() and SSL_set_quiet_shutdown() β€” do not return diagnostic information. nothing. void. they set and they dip. πŸ’…
  • SSL_CTX_get_quiet_shutdown() and SSL_get_quiet_shutdown() β€” return the current setting. that's the whole answer.

πŸ‘‘ SEE ALSO πŸ‘‘

ssl(7), SSL_shutdown(3), SSL_set_shutdown(3), SSL_new(3), SSL_clear(3), SSL_free(3)


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, babes 🧚 this one's from OpenSSL 3.5.9, dated 2026-09-29, and it's the SSL_CTX_SET_QUIET_SHUTDOWN(3ossl) manual page β€” now go set your flags responsibly, mwah πŸ’–πŸŒΈβœ¨

πŸ“¦ where this page comes from