SSL_CTX_SET_TMP_ECDH(3ossl)

πŸ’– SSL_CTX_SET_TMP_ECDH πŸ’–

okay bestie, this is the SSL_CTX_SET_TMP_ECDH(3ossl) page from the OpenSSL manual, and it's giving "vintage" in the most deprecated way possible πŸ’€. We're talking about the ECDH keys for ephemeral key exchange β€” the little curve-diffie-hellman moment where two strangers on the internet agree on a secret without ever saying it out loud. iconic behavior honestly πŸ¦‹


✨ NAME ✨

SSL_CTX_set_tmp_ecdh, SSL_set_tmp_ecdh, SSL_CTX_set_ecdh_auto, SSL_set_ecdh_auto β€” handle ECDH keys for ephemeral key exchange πŸ”


🌸 SYNOPSIS 🌸

#include <openssl/ssl.h>

long SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ecdh);
long SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ecdh);

long SSL_CTX_set_ecdh_auto(SSL_CTX *ctx, int state);
long SSL_set_ecdh_auto(SSL *ssl, int state);

like, look at them. four little functions. two of them actually do something πŸ‘€


πŸŽ€ DESCRIPTION πŸŽ€

  • SSL_CTX_set_tmp_ecdh() β€” sets the ECDH parameters to be used to be ecdh. And the way that key gets inherited by every single ssl object created from ctx? main character energy fr fr πŸ‘‘ so you set it once on the context and all the babies get it.
heads up bestie: this macro is deprecated in favor of SSL_CTX_set1_groups(3). it's not canceled exactly, but it's definitely on thin ice πŸ’…
  • SSL_set_tmp_ecdh() β€” this one sets the parameters only for ssl. just the one. no inheritance, no group chat, just a solo moment.
also deprecated, this time in favor of SSL_set1_groups(3). the new one ate and left no crumbs, sorry 😭
  • SSL_CTX_set_ecdh_auto() and SSL_set_ecdh_auto() β€” these two are deprecated and have no effect. that's it. that's the whole thing. they literally do nothing. not me calling functions that are just vibes πŸ’€βœ¨

πŸ’œ RETURN VALUES πŸ’œ

  • SSL_CTX_set_tmp_ecdh() and SSL_set_tmp_ecdh() return 1 on success 🫢
  • and 0 on failure πŸ™ˆ

that's it. binary. slay or flop, no in-between.


🌈 SEE ALSO 🌈

go read these next, bestie, they're the upgraded versions and the friends of this page:

iykyk, the set1_groups girlies are the ones you actually want πŸ’…


Copyright 2018 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, bestie!! πŸŽ€ this one came straight out of the OpenSSL 3.5.9 distribution, dated 2026-09-29, and it lives in the manual as SSL_CTX_SET_TMP_ECDH(3ossl) πŸ’– go forth and use SSL_CTX_set1_groups(3) instead, mwah 🫢✨

πŸ“¦ where this page comes from