SSL_CONF_CTX_SET1_PREFIX(3ossl)

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

πŸ’… SSL_CONF_CTX_SET1_PREFIX πŸ’…

okay bestie, so this is a page from the OpenSSL manuals (3ossl), and ngl it's a short one β€” but it's lowkey important, so let's get into it πŸŽ€


✨ NAME ✨

SSL_CONF_CTX_set1_prefix β€” set the command prefix on a configuration context, periodt ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <openssl/ssl.h>

unsigned int SSL_CONF_CTX_set1_prefix(SSL_CONF_CTX *cctx, const char *prefix);

Like, that's the whole vibe. One function, two args, we move πŸ’…


🌸 DESCRIPTION 🌸

So SSL_CONF_CTX_set1_prefix() takes your context cctx and sets its command prefix to prefix. That's it, that's the function 🫢

And if you pass NULL as prefix? It just gets restored back to the default value. Cute little reset moment πŸ’–


πŸ‘‘ NOTES πŸ‘‘

okay so this is the part you actually need, bestie, don't skip it πŸ™ˆ

Command prefixes alter the commands recognised by subsequent SSL_CONF_cmd() calls. So like, they change what gets matched later on.

For example, for files: if you set the prefix "SSL", then command names such as "SSLProtocol", "SSLOptions" etc. are recognised β€” instead of just "Protocol" and "Options". Iconic, honestly 🌈

Similarly for command lines: if the prefix is "--ssl-", then "--ssl-no_tls1_2" is recognised instead of "-no_tls1_2". See the pattern? The prefix is literally prepended energy ✨

Now the flag-dependent tea β˜•:

  • If the SSL_CONF_FLAG_CMDLINE flag is set, then prefix checks are case sensitive and "-" is the default.
  • In the unlikely event (yes, the manpage says "unlikely even", we love a typo moment 😭) an application explicitly wants to set no prefix β€” it must be explicitly set to "". Like, empty string. Not NULL. "". Fr fr πŸ’€
  • If the SSL_CONF_FLAG_FILE flag is set, then prefix checks are case insensitive and no prefix is the default.
Lowkey important: NULL restores the default, but "" is an actual empty prefix. They are NOT the same thing, bestie. Don't mix them up πŸ™ˆ

⭐ RETURN VALUES ⭐

SSL_CONF_CTX_set1_prefix() returns 1 for success and 0 for failure. Simple as that πŸ’…


🧚 SEE ALSO 🧚

Go read these next, iykyk:


πŸŽ€ HISTORY πŸŽ€

These functions were added in OpenSSL 1.0.2. Vintage but still slaying πŸ‘‘


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


okay that's the whole page bestie, you ate that πŸ“βœ¨

πŸ¦‹ tiny sign-off: this was OpenSSL 3.5.6, dated 2026-04-07, and the page is SSL_CONF_CTX_SET1_PREFIX(3ossl). go forth and prefix responsibly πŸ’–
πŸ“¦ where this page comes from