SSL_GET_VERSION(3ossl)
π SSL_GET_VERSION π
okay bestie, welcome to the SSL_GET_VERSION(3ossl) page β this is the part of OpenSSL that answers the question every girl asks at some point: "so like... what protocol are we even speaking rn?" β¨
πΈ 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. that's it. that's the whole job. she's a looker-upper π
π 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 β¨
okay so for the SSL, TLS and DTLS protocols, SSL_client_version() hands you the numeric protocol version that the client advertised in the legacy_version field of the ClientHello when it kicked off the connection. π«Ά
β οΈ but wait β important β for TLS, this value will never indicate a version greater than TLSv1.2, even if TLSv1.3 gets negotiated later. she said what she said and she's not updating her bio. π
For QUIC connections though? It returns OSSL_QUIC1_VERSION. different vibes entirely.
SSL_get_version() gives you the name of the protocol used for the connection. SSL_version() gives you the numeric protocol version used for the connection. π
π¨ bestie listen β these two should only be called after the initial handshake has been completed. Prior to that, the results coming back from these functions may be unreliable. don't be nosy before the handshake is done, it's not cute. π
SSL_is_dtls() returns 1 if the connection is using DTLS or 0 if not. π
SSL_is_tls() returns 1 if the connection is using SSL/TLS or 0 if not. π
SSL_is_quic() returns 1 if the connection is using QUIC or 0 if not. π
yes they're all the same shape. yes it's giving "copy paste but make it fashion". we move.
π₯ RETURN VALUES π₯
π what SSL_get_version() gives you back
she returns one of the following strings, no cap:
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 protocolDTLSv1β The connection uses the DTLSv1 protocolDTLSv1.2β The connection uses the DTLSv1.2 protocolQUICv1β The connection uses the QUICv1 protocol.unknownβ This indicates an unknown protocol version. (mystery era π)
π what SSL_version() and SSL_client_version() give you back
they return an integer which could include any of the following, bestie:
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 protocolDTLS1_VERSIONβ The connection uses the DTLSv1 protocolDTLS1_2_VERSIONβ The connection uses the DTLSv1.2 protocolOSSL_QUIC1_VERSIONβ The connection uses the QUICv1 protocol.
π¦ SEE ALSO π¦
ssl(7)β go read her, she's the main character of this whole saga π
π HISTORY π
- The
SSL_is_dtls()function was added in OpenSSL 1.1.0. π± - The
SSL_is_tls()andSSL_is_quic()functions 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!! π this was OpenSSL 3.5.9, dated 2026-09-29, and it's the SSL_GET_VERSION(3ossl) manual β go forth and version-check your connections responsibly, mwah π
π
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms