SSL_GET_VERSION(3)

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

okay bestie, welcome to the SSL_GET_VERSION(3) page from the Library Functions Manual β€” it's giving protocol-detective energy, and honestly it's iconic. This one is all about getting the protocol information of a connection. πŸŽ€

✨ NAME ✨

SSL_get_version, SSL_is_dtls, and SSL_version β€” the trio that gets the protocol information of a connection. slay. πŸ’…

🌸 SYNOPSIS 🌸

The synopsis has this library line, exactly:

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

Then the function signatures, no cap:

const char *
SSL_get_version(const SSL *ssl);

int
SSL_is_dtls(const SSL *ssl);

int
SSL_version(const SSL *ssl);

πŸ’– DESCRIPTION πŸ’–

  • SSL_get_version() returns the name of the protocol used for the connection ssl. name-drop that protocol, bestie.
  • SSL_is_dtls() returns 1 if the connection is using DTLS, 0 if not.
  • SSL_version() returns an integer constant representing that protocol.
Important handshake vibe check: these functions only return reliable results after the initial handshake has been completed. So don't ask before the handshake is done β€” it's literally not ready. 😭

πŸ”₯ RETURN VALUES πŸ”₯

The following strings or integers can be returned by SSL_get_version() and SSL_version():

  • "TLSv1" or TLS1_VERSION β€” the connection uses the TLSv1.0 protocol. πŸ’–
  • "TLSv1.1" or TLS1_1_VERSION β€” the connection uses the TLSv1.1 protocol. ✨
  • "TLSv1.2" or TLS1_2_VERSION β€” the connection uses the TLSv1.2 protocol. πŸ¦‹
  • "TLSv1.3" or TLS1_3_VERSION β€” the connection uses the TLSv1.3 protocol. 🌸
  • "DTLSv1" or DTLS1_VERSION β€” the connection uses the Datagram Transport Layer Security 1.0 protocol. πŸŽ€
  • "DTLSv1.2" or DTLS1_2_VERSION β€” the connection uses the Datagram Transport Layer Security 1.2 protocol. 🌈
  • "unknown" β€” this indicates an unknown protocol version; it cannot currently happen with LibreSSL. πŸ’€

SSL_is_dtls() returns 1 if the connection uses DTLS, 0 if not. 🫢

πŸŽ€ SEE ALSO πŸŽ€

  • ssl(3) β€” go read this too, iykyk.

πŸ‘‘ HISTORY πŸ‘‘

  • SSL_get_version() and SSL_version() first appeared in SSLeay 0.8.0 and have been available since OpenBSD 2.4. ⭐
  • SSL_is_dtls() first appeared in OpenSSL 1.1.0 and has been available since OpenBSD 6.9. πŸ’œ

xoxo, your favorite manual page β€” this footer moment comes from Debian, dated June 8, 2025, signing off as SSL_GET_VERSION(3) πŸ’‹βœ¨

πŸ“¦ where this page comes from