SSL_CTX_SET1_GROUPS(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸŽ€ SSL_CTX_SET1_GROUPS(3) πŸŽ€

hiii bestie! this page is from the Library Functions Manual, and it’s literally all about choosing your supported EC groups. no cap, let’s get into it πŸ’–

🌈 NAME 🌈

SSL_CTX_set1_groups, SSL_CTX_set1_groups_list, SSL_set1_groups, SSL_set1_groups_list, SSL_CTX_set1_curves, SSL_CTX_set1_curves_list, SSL_set1_curves, SSL_set1_curves_list β€” choose supported EC groups πŸ’…

✨ SYNOPSIS ✨

library β€œlibssl” libcrypto
#include <openssl/ssl.h>
int
SSL_CTX_set1_groups(SSL_CTX *ctx, const int *glist, size_t glistlen);

int
SSL_CTX_set1_groups_list(SSL_CTX *ctx, const char *list);

int
SSL_set1_groups(SSL *ssl, const int *glist, size_t glistlen);

int
SSL_set1_groups_list(SSL *ssl, const char *list);

int
SSL_CTX_set1_curves(SSL_CTX *ctx, const int *clist, size_t clistlen);

int
SSL_CTX_set1_curves_list(SSL_CTX *ctx, const char *list);

int
SSL_set1_curves(SSL *ssl, const int *clist, size_t clistlen);

int
SSL_set1_curves_list(SSL *ssl, const char *list);

🌸 DESCRIPTION 🌸

okay so SSL_CTX_set1_groups() sets the supported groups for ctx to the glistlen groups in the array glist. that array consists of group NIDs in preference order. for a TLS client, the groups are used directly in the supported groups extension. for a TLS server, the groups are used to determine the set of shared groups. slay.

SSL_CTX_set1_groups_list() sets the supported groups for ctx to the list represented as a colon separated list of group NIDs or names, for example "P-521:P-384:P-256" ✨

SSL_set1_groups() and SSL_set1_groups_list() are similar except that they set supported groups for the SSL structure ssl only 🫢

🚨 bestie, heads up: the curve functions are deprecated synonyms for the equivalently named group functions and are identical in every respect except that they are implemented as macros. they exist because prior to TLS1.3, there was only the concept of supported curves. in TLS1.3, this was renamed to supported groups and extended to include Diffie Hellman groups. iconic lore, but still deprecated 😭

if an application wishes to make use of several of these functions for configuration purposes either on a command line or in a file, it should consider using the SSL_CONF interface instead of manually parsing options. periodt πŸ’…

πŸ’« RETURN VALUES πŸ’«

all these functions return 1 for success or 0 for failure. that’s it, that’s the vibe check πŸ”₯

🫢 SEE ALSO 🫢

πŸ‘‘ HISTORY πŸ‘‘

the curve functions first appeared in OpenSSL 1.0.2 and the group functions in OpenSSL 1.1.1. both have been available since OpenBSD 6.1. history ate, ngl πŸ¦‹


xoxo, Debian πŸ’… β€” June 8, 2025 ✨ page: SSL_CTX_SET1_GROUPS(3) πŸŽ€

πŸ“¦ where this page comes from