SSL_GET_VERSION(3ossl)
π SSL_GET_VERSION β get the protocol info of a connection
okay so bestie, this is the 3ossl manual page, and it's literally all about finding out what protocol a connection is actually speaking. icon behavior fr.
β¨ NAME β¨
SSL_client_version, SSL_get_version, SSL_is_dtls, SSL_is_tls, SSL_is_quic, SSL_version β get the protocol information of a connection π«Ά
π SYNOPSIS π
#include <openssl/ssl.h>
int SSL_client_version(const SSL *s);
const char *SSL_get_version(const SSL *ssl);
int SSL_is_dtls(const SSL *ssl);
int SSL_is_tls(const SSL *ssl);
int SSL_is_quic(const SSL *ssl);
int SSL_version(const SSL *s);
πΈ DESCRIPTION πΈ
so for SSL, TLS and DTLS protocols, SSL_client_version() returns the numeric protocol version that the client advertised in the legacy_version field of the ClientHello when it kicked off the connection. π«
heads up bestie: for TLS, this value will never indicate a version greater than TLSv1.2 β even if TLSv1.3 ends up being negotiated later. no cap. π
for QUIC connections it returns OSSL_QUIC1_VERSION.
SSL_get_version() returns the name of the protocol used for the connection. SSL_version() returns the numeric protocol version used for the connection. π₯
β οΈ both of these should only be called after the initial handshake has been completed. before that? the results may be unreliable. the vibe check just isn't ready yet, ngl.
SSL_is_dtls()β returns1if the connection is using DTLS,0if not.SSL_is_tls()β returns1if the connection is using SSL/TLS,0if not.SSL_is_quic()β returns1if the connection is using QUIC,0if not. π¦
β RETURN VALUES β
π SSL_get_version() returns one of these strings:
SSLv3β the connection uses the SSLv3 protocol.TLSv1β the connection uses the TLSv1.0 protocol.TLSv1.1β the connection uses the TLSv1.1 protocol.TLSv1.2β the connection uses the TLSv1.2 protocol.TLSv1.3β the connection uses the TLSv1.3 protocol.DTLSv0.9β the connection uses an obsolete pre-standardisation DTLS protocol.DTLSv1β the connection uses the DTLSv1 protocol.DTLSv1.2β the connection uses the DTLSv1.2 protocol.QUICv1β the connection uses the QUICv1 protocol.unknownβ this indicates an unknown protocol version. π
π¦ SSL_version() and SSL_client_version() return an integer, which could include any of the following:
SSL3_VERSIONβ the connection uses the SSLv3 protocol.TLS1_VERSIONβ the connection uses the TLSv1.0 protocol.TLS1_1_VERSIONβ the connection uses the TLSv1.1 protocol.TLS1_2_VERSIONβ the connection uses the TLSv1.2 protocol.TLS1_3_VERSIONβ the connection uses the TLSv1.3 protocol (never returned forSSL_client_version()).DTLS1_BAD_VERβ the connection uses an obsolete pre-standardisation DTLS protocol.DTLS1_VERSIONβ the connection uses the DTLSv1 protocol.DTLS1_2_VERSIONβ the connection uses the DTLSv1.2 protocol.OSSL_QUIC1_VERSIONβ the connection uses the QUICv1 protocol.
π SEE ALSO π
ssl(7) β go read it, iykyk β¨
π HISTORY π
SSL_is_dtls()was added in OpenSSL 1.1.0.SSL_is_tls()andSSL_is_quic()were added in OpenSSL 3.2.
π COPYRIGHT π
Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
and that's the whole page bestie, slay π this was version 3.5.6, dated 2026-04-07 β go forth and check ur protocol versions, periodt πβ¨
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms