SSL_RENEGOTIATE(3)
π SSL_RENEGOTIATE(3) β Library Functions Manual β¨
okay so bestie, welcome to libssl's renegotiation club π this is the page for all three of the renegotiate girlies, and yes it's called SSL_RENEGOTIATE but it covers the whole squad. sit down, hydrate, let's go π
πΈ SYNOPSIS πΈ
the vibe check first β these live in the libssl and libcrypto libraries:
#include <openssl/ssl.h>
and the three function signatures, literally copy-paste-able:
int
SSL_renegotiate(SSL *ssl);
int
SSL_renegotiate_abbreviated(SSL *ssl);
int
SSL_renegotiate_pending(SSL *ssl);
π¦ DESCRIPTION π¦
β¨ SSL_renegotiate() β the client-side era
so when you call SSL_renegotiate() from the client side, it schedules a completely new handshake over an existing TLS connection. like, the connection's already there, we're just doing the handshake again for funsies (and security). β¨
the next time an I/O operation such as SSL_read() or SSL_write() takes place on the connection, a check is performed to confirm that it's a suitable time to start a renegotiation. if so, a new handshake is initiated immediately β no waiting, main character energy π₯
π important-ish detail: an existing session associated with the connection is not resumed. fresh handshake, fresh session, periodt.
this function is automatically called by SSL_read(3) and SSL_write(3) whenever the renegotiation byte count set by BIO_set_ssl_renegotiate_bytes(3) or the timeout set by BIO_set_ssl_renegotiate_timeout(3) are exceeded. so lowkey it's doing this for you already π
π
SSL_renegotiate_abbreviated() β the client-side remix
when called from the client side, SSL_renegotiate_abbreviated() is similar to SSL_renegotiate() except that resuming the session associated with the current connection is attempted in the new handshake. so it's the same bop, just shortened β we're trying to pick up where we left off π
π«Ά server-side behavior β yes it's different, ngl
when called from the server side, SSL_renegotiate() and SSL_renegotiate_abbreviated() behave identically. they both schedule a request for a new handshake to be sent to the client β¨
the next time an I/O operation is performed, the same checks as on the client side are performed and then, if appropriate, the request is sent. the client may or may not respond with a new handshake and it may or may not attempt to resume an existing session β we don't control the client's choices, bestie, we just send the vibe π
if a new handshake is started, it is handled transparently during any I/O function. so you don't have to do anything extra, it just happens π
π if you're a LibreSSL client and a server asks to renegotiate
if a LibreSSL client receives a renegotiation request from a server, it is also handled transparently during any I/O function π§ the client attempts to resume the current session in the new handshake. for historical reasons, DTLS clients do not attempt to resume the session in the new handshake β that's just how DTLS has always been, iykyk π
β RETURN VALUES β
SSL_renegotiate()andSSL_renegotiate_abbreviated()β return1on success or0on error πSSL_renegotiate_pending()β returns1if a renegotiation or renegotiation request has been scheduled but not yet acted on, or0otherwise π
π SEE ALSO π
ssl(3), SSL_do_handshake(3), SSL_num_renegotiations(3), SSL_read(3), SSL_write(3) β go read these too, they're literally the supporting cast π
πΈ HISTORY πΈ
SSL_renegotiate()first appeared in SSLeay 0.8.0 and has been available since OpenBSD 2.4 πSSL_renegotiate_pending()first appeared in OpenSSL 0.9.7 and has been available since OpenBSD 3.2 β¨SSL_renegotiate_abbreviated()first appeared in OpenSSL 1.0.1 and has been available since OpenBSD 5.3 π¦
that's the whole page, bestie π«Ά this one's from the Debian edition, dated June 8, 2025, and honestly? iconic. go forth and renegotiate responsibly πβ¨π
π¦ where this page comes from
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
- Copyright (c) 2017 The OpenSSL Project. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms