SSL_GET_VERSION(3)
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 connectionssl. name-drop that protocol, bestie.SSL_is_dtls()returns1if the connection is using DTLS,0if 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"orTLS1_VERSIONβ the connection uses the TLSv1.0 protocol. π"TLSv1.1"orTLS1_1_VERSIONβ the connection uses the TLSv1.1 protocol. β¨"TLSv1.2"orTLS1_2_VERSIONβ the connection uses the TLSv1.2 protocol. π¦"TLSv1.3"orTLS1_3_VERSIONβ the connection uses the TLSv1.3 protocol. πΈ"DTLSv1"orDTLS1_VERSIONβ the connection uses the Datagram Transport Layer Security 1.0 protocol. π"DTLSv1.2"orDTLS1_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()andSSL_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
- alpine 3.24: libressl-doc 4.3.1-r0 Β· custom
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2001, 2005, 2014 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