gnutls_rehandshake(3)
π gnutls_rehandshake(3) β the gnutls manual, bestie edition π
okay so this is a page from the gnutls manual, and today's main character is gnutls_rehandshake. it's from version 3.8.13 btw, keep that in your pocket π«Ά
β¨ NAME β¨
gnutls_rehandshake β literally just an API function, that's the whole vibe π
πΈ SYNOPSIS πΈ
#include <gnutls/gnutls.h>
int gnutls_rehandshake(gnutls_session_t session);
π ARGUMENTS π
gnutls_session_t sessionβ bestie this is agnutls_session_ttype. that's it, that's the arg π¦
π DESCRIPTION π
okay so listen. this function can only be called on the server side, no cap. what it does is it tells a TLS 1.2-or-earlier client to renegotiate parameters β like, actually do a handshake β by sending a hello request message. so polite of it β¨
if this function succeeds, the calling application should keep calling gnutls_record_recv() until GNUTLS_E_REHANDSHAKE comes back, so that any pending data gets cleared out. and if you don't see the GNUTLS_E_REHANDSHAKE error code? then the handshake request was not followed by the peer. and honestly, not a scandal β the TLS protocol does not require the client to do it, and that kind of compliance should be handled by the application protocol. so don't come for the client, it's allowed π
once the GNUTLS_E_REHANDSHAKE error code is seen, the calling application should proceed to call gnutls_handshake() to negotiate the new parameters. go go go πβοΈ
and if the client does not wish to renegotiate parameters, he may reply with an alert message β and in that case the return code you'll see from subsequent gnutls_record_recv() calls will be GNUTLS_E_WARNING_ALERT_RECEIVED, with the specific alert being GNUTLS_A_NO_RENEGOTIATION. a client may also just choose to ignore this request entirely. silence is an answer, i guess π
under TLS 1.3 this function is equivalent to gnutls_session_key_update() with the GNUTLS_KU_PEER flag. in that case, subsequent calls to gnutls_record_recv() will not return GNUTLS_E_REHANDSHAKE, and calls to gnutls_handshake() on the server side are a no-op. nothing happens. it's giving ghosting π»
and yeah β this function always fails with GNUTLS_E_INVALID_REQUEST when called on the client side. like, always always. don't try it bestie, it's not your moment π
π RETURNS π
GNUTLS_E_SUCCESS on success π, otherwise a negative error code. sad girl hours but make it a return value.
π REPORTING BUGS π
found a bug? spill it to <bugs@gnutls.org> π
home page: https://www.gnutls.org β go say hi π
π COPYRIGHT π
Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.
copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. so like, keep the receipt, that's all we ask π§Ύβ¨
π¦ SEE ALSO π¦
the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, go visit:
https://www.gnutls.org/manual/
it's right there waiting for you, iykyk π
and that's the whole page!! this was gnutls_rehandshake(3) from the gnutls manual, version 3.8.13 β mwah, slay, no cap, periodt π
ππΈ
go renegotiate responsibly bestie π«Ά
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms