gnutls_handsha..._hello_function(3)
β¨ gnutls_handshake_set_post_client_hello_function β¨
okay bestie, welcome to the gnutls manual, page three of gnutls_handshake_set_post_client_hello_function π this one's short but it's important, so sit with me for a sec π«Ά
πΈ NAME πΈ
gnutls_handshake_set_post_client_hello_function β it's an API function, no cap β¨
π SYNOPSIS π
#include <gnutls/gnutls.h>
void gnutls_handshake_set_post_client_hello_function(gnutls_session_t
session, gnutls_handshake_simple_hook_func func);
likeβ¦ look at her. iconic signature, she's serving π
π¦ ARGUMENTS π¦
gnutls_session_t sessionβ bestie this is agnutls_session_ttype. that's it, that's the whole vibe πgnutls_handshake_simple_hook_func funcβ the function that's gonna get called. your little callback, your moment π
π DESCRIPTION π
so what this function does is set a callback that gets called after the client hello has been received. and listen β this callback is valid in server side only, so if you're on the client side this is not your era π
what's it for? it lets the server adjust settings based on the received extensions β¨
and when we say "settings" we mean stuff like ciphersuites, requesting a certificate, or literally anything else β with one exception: version negotiation. you can't touch that one, because it already happened before the hello message even got parsed. the past is the past, she's moved on π
this callback must return 0 on success, or a gnutls error code to terminate the handshake. no in-between, no "ehhh maybe", it's giving decisive queen π
and since GnuTLS 3.3.5, the callback is allowed to return GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED to put the handshake on hold βΈοΈ when that happens, gnutls_handshake() will return GNUTLS_E_INTERRUPTED and you can resume it whenever you need to. so flexible. so considerate. we love a comeback arc π
π WARNING π
okay this part is serious, bestie, pay attention: you should not use this function to terminate the handshake based on client input unless you genuinely know what you are doing. because before the handshake is finished, there is no way to know if there's a man-in-the-middle attack being performed. no way. none. so be careful out there fr fr π
π REPORTING BUGS π
found a bug? report it to <bugs@gnutls.org> π
home page: https://www.gnutls.org π
π 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. slay, and also legally binding, but slay π
π₯ 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, visit:
https://www.gnutls.org/manual/
and that's the whole page, bestie!! π this was the gnutls manual, 3.8.13 edition, gnutls_handsha..._hello_function(3) β thank u for reading, mwah ππ¦β¨
π¦ 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