LIBRESSL-SSL_CTX_SET_TMP_RSA_CALLBACK(3)

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

πŸ’… SSL_CTX_SET_TMP_RSA_CALL(3) β€” the libssl one, bestie

okay so real talk: this page lives in libssl, and honestly it's giving "vintage mall decoration that nobody's allowed to take down." Come learn about it with me ✨


πŸ¦‹ SYNOPSIS

library β€œlibssl” libcrypto #include <openssl/ssl.h>

void
SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
    RSA *(*tmp_rsa_callback)(SSL *ssl, int is_export, int keylength));

long
SSL_CTX_set_tmp_rsa(SSL_CTX *ctx, RSA *rsa);

long
SSL_CTX_need_tmp_RSA(SSL_CTX *ctx);

void
SSL_set_tmp_rsa_callback(SSL_CTX *ctx,
    RSA *(*tmp_rsa_callback)(SSL *ssl, int is_export, int keylength));

long
SSL_set_tmp_rsa(SSL *ssl, RSA *rsa);

long
SSL_need_tmp_RSA(SSL *ssl);

(yes, SSL_set_tmp_rsa_callback really does take an SSL_CTX *ctx up there β€” that's literally what it says, I'm not touching it πŸ™ˆ)


🌸 DESCRIPTION

okay so storytime: these functions are all deprecated, full stop. They only ever mattered for RSA authentication that was deliberately insecure, because the historical U.S. export restrictions literally mandated it. So like… yeah. Not the vibe anymore. πŸ’€

And here's the thing β€” they currently have no effect, except that SSL_CTX_set_tmp_rsa_callback(), SSL_CTX_set_tmp_rsa(), SSL_set_tmp_rsa_callback(), and SSL_set_tmp_rsa() will issue error messages when you call them. That's it. That's the whole personality. They yell at you and then do nothing. Weird flex but okay 🫠

if you were hoping to actually manage ephemeral RSA keys with these β€” nope. They're museum pieces. Don't call them in new code, periodt.

✨ RETURN VALUES

These functions always return 0, indicating failure. Every single one. Zero rizz, zero success, just 0. 😭


πŸŽ€ SEE ALSO

go read these instead, they're the main characters πŸ’œ


πŸ‘‘ HISTORY

SSL_CTX_set_tmp_rsa_callback(), SSL_CTX_set_tmp_rsa(), and SSL_CTX_need_tmp_RSA() β€” those three slayed their way into existence in SSLeay 0.8.0, and have been available since OpenBSD 2.4. iconic longevity honestly ⭐

Then SSL_set_tmp_rsa_callback(), SSL_set_tmp_rsa(), and SSL_need_tmp_RSA() showed up later in OpenSSL 0.9.2b, available since OpenBSD 2.6. the sequel nobody asked for but we respect it 🌈


and that's the whole page bestie πŸ¦‹ this little artifact came out of the Debian build dated June 8, 2025, filed under SSL_CTX_SET_TMP_RSA_CALLBACK(3) β€” stay safe, stay deprecated, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from