SSL_GET_FINISHED(3)

πŸ“¦
version 4.4.0 Β· 2 versions
, in arch rolling

πŸ’… SSL_GET_FINISHED(3) πŸ’…

okay so bestie, welcome to the Library Functions Manual for libssl β€” yes the crypto one, come on in 🫢


✨ NAME ✨

SSL_get_finished, SSL_get_peer_finished β€” grab the last finished message that got sent, or the last one you're expecting πŸ‘€


🌸 SYNOPSIS 🌸

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

size_t
SSL_get_finished(const SSL *ssl, void *buf, size_t count);

size_t
SSL_get_peer_finished(const SSL *ssl, void *buf, size_t count);

literally just two functions, both returning size_t, both taking an const SSL *ssl, a void *buf and a size_t count. iconic signature, no notes πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: SSL_get_finished() and SSL_get_peer_finished() copy count bytes into the caller-provided buffer buf πŸ’– and where do those bytes come from? glad you asked bestie:

  • SSL_get_finished() β€” from the last finished message sent to the peer
  • SSL_get_peer_finished() β€” from the last finished message expected from the peer

and like, what even is the finished message? ngl it's kind of the main character of the handshake β€” it's computed from a checksum of the handshake records exchanged with the peer πŸ”₯. its length depends on the ciphersuite in use, and it's at most EVP_MAX_MD_SIZE, i.e., 64 bytes. that's the ceiling, bestie, don't come for it πŸŽ€


⭐ RETURN VALUES ⭐

both functions return the number of bytes copied into buf 🫢.

the return value is zero if the handshake has not reached the finished message β€” so if you get 0, that handshake said "not yet" and honestly same 😭


🌈 SEE ALSO 🌈

go read those too, iykyk πŸ“šβœ¨


πŸŽ€ STANDARDS πŸŽ€

  • RFC 9846: The Transport Layer Security (TLS) Protocol Version 1.3, section 4.5.3: Finished.
  • RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2, section 7.4.9: Finished.

like yes, both versions, we contain multitudes πŸ’œ


πŸ‘‘ HISTORY πŸ‘‘

SSL_get_finished() and SSL_get_peer_finished() first appeared in SSLeay 0.9.5 and have been available since OpenBSD 2.7 β€” absolute elders, they've been slaying since before we were born πŸ™ˆπŸ•°οΈ


okay that's the whole page bestie, no cap 🧚

sign-off szn: this one's from Debian, dated August 21, 2026, and it's SSL_GET_FINISHED(3) β€” periodt πŸ’…πŸ’–

πŸ“¦ where this page comes from
  • arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms