SSL_CTX_CTRL(3ossl)

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

πŸ’… SSL_CTX_CTRL β€” the OpenSSL internal-handling-functions page, but make it make sense

Okay so this is a page from the OpenSSL manual, section 3ossl (yes, 3ossl β€” that's the manual section it lives in, bestie), and it's about four functions that are, and I cannot stress this enough, not for you to call directly. Let me walk you through it 🫢


✨ NAME ✨

SSL_CTX_ctrl, SSL_CTX_callback_ctrl, SSL_ctrl, SSL_callback_ctrl β€” these are the internal handling functions for SSL_CTX and SSL objects. Emphasis on internal. Like, backstage-crew energy, not main character energy πŸ”₯


🌸 SYNOPSIS 🌸

Here's the whole cast, verbatim, no edits, iykyk:

#include <openssl/ssl.h>

long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg);
long SSL_CTX_callback_ctrl(SSL_CTX *, int cmd, void (*fp)());

long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg);
long SSL_callback_ctrl(SSL *, int cmd, void (*fp)());

Note that the callback ones don't even bother to name their first parameter β€” it's just SSL_CTX * and SSL *, sitting there anonymous and mysterious πŸ’€ Not me being obsessed with that. Literally just vibes.


πŸ¦‹ DESCRIPTION πŸ¦‹

So the SSL_*_ctrl() family is what's used to manipulate settings of the SSL_CTX and SSL objects β€” like, the knobs and dials of your TLS setup, lowkey.

Depending on which command you pass as cmd, the arguments larg, parg, or fp get evaluated. Different command, different argument gets the attention. It's giving "the cmd picks which of my friends I'm listening to today" πŸ’…

⚠️ Now here's the big one, the thing you HAVE to internalise: these functions should never be called directly. Like, ever. Not once. Not even to see what happens. All the functionality you actually need is made available via other functions or macros. So if you caught yourself reaching for SSL_CTX_ctrl, put your hands down, queen, and go use the real public API 🌈

πŸ‘‘ RETURN VALUES πŸ‘‘

The return values of the SSL*_ctrl() functions depend on the command supplied via the cmd parameter. That's it. That's the whole section. There's no universal answer, no fixed thing to expect β€” the cmd you picked decides what you get back. Choose wisely πŸŽ€


⭐ SEE ALSO ⭐

  • ssl(7) β€” go read that one, bestie, it's the one that actually explains things πŸ’–

Copyright 2001-2016 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 page!! πŸŽ€ No cap, the whole thing. Shoutout to the 3.5.0 version and the 2026-09-25 date down there at the bottom in the footer β€” that's your little timestamped bow on top of this whole thing, and honestly? Iconic. Periodt. πŸ’œ

πŸ“¦ where this page comes from