SSL_CTX_SET_QUIET_SHUTDOWN(3ossl)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸ’… SSL_CTX_SET_QUIET_SHUTDOWN β€” the 3ossl girlies' guide to shutting things down quietly ✨

Okay bestie, buckle up πŸŽ€ this is the 3ossl manual page for four little functions that control whether your TLS goodbye is loud and proper or, like, silent and slightly illegal. Yes, illegal. We'll get there. πŸ’€


🌸 NAME 🌸

SSL_CTX_set_quiet_shutdown, SSL_CTX_get_quiet_shutdown, SSL_set_quiet_shutdown, SSL_get_quiet_shutdown β€” literally the four functions that manipulate shutdown behaviour. Get/set, context/object, quiet mode. That's the whole vibe check. πŸ¦‹


✨ 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);

Copy it exactly, bestie, don't freestyle the signatures. πŸ™ˆ


πŸ’– DESCRIPTION πŸ’–

So here's the tea, one function at a time:

  • SSL_CTX_set_quiet_shutdown() β€” sets the "quiet shutdown" flag for ctx to be mode. And the inherited-lore is real: SSL objects created from ctx inherit the mode that was valid at the time SSL_new(3) is called. mode may be 0 or 1. That's it. That's the whole range. Main character energy only has two settings. πŸ‘‘
  • SSL_CTX_get_quiet_shutdown() β€” returns the "quiet shutdown" setting of ctx. Reading is free, no cap. πŸ“–
  • SSL_set_quiet_shutdown() β€” sets the "quiet shutdown" flag for ssl to be mode. The setting stays valid until ssl is removed with SSL_free(3) or SSL_set_quiet_shutdown() is called again. Important detail alert 🚨: it is not changed when SSL_clear(3) is called. mode may be 0 or 1. Same two options, she's consistent. πŸ’…
  • SSL_get_quiet_shutdown() β€” returns the "quiet shutdown" setting of ssl. Iconic, brief, does what it says. 🌟
🫢 And now the caveat nobody wants to hear: these functions are not supported for QUIC SSL objects. SSL_set_quiet_shutdown() has no effect if called on a QUIC SSL object. Like, zero. Nothing. It's giving "talking to a wall". 😭

🧚 NOTES 🧚

Okay so 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, standards-respecting, "thank you for the conversation" behaviour. 🌸

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. (And SSL_shutdown(3) then behaves like SSL_set_shutdown(3) called with SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN.) So the session is thus considered to be shutdown, but no close_notify alert is sent to the peer. πŸ«₯

πŸ’€ And yeah β€” this behaviour violates the TLS standard. Not a vibe, not a flex, just a fact. Say it with me: quiet shutdown is a standard-breaker. Use it knowing that.

The default is normal shutdown behaviour as described by the TLS standard. Which is to say: the loud, correct, close_notify-sending behaviour is what you get unless you deliberately opt in to the chaos. 😌


πŸ“ RETURN VALUES πŸ“

  • SSL_CTX_set_quiet_shutdown() and SSL_set_quiet_shutdown() do not return diagnostic information. Nothing. Void. They simply do. Silent kings. 🀫
  • SSL_CTX_get_quiet_shutdown() and SSL_get_quiet_shutdown() return the current setting. Yes, the 0 or 1 situation. πŸ“Š

πŸ”₯ SEE ALSO πŸ”₯

Go read them, 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! This masterpiece is from OpenSSL version 3.5.6, dated 2026-04-07, and it's filed under SSL_CTX_SET_QUIET_SHUTDOWN(3ossl). Go forth and shut down β€” quietly, if you dare. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from