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 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. (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 for SSL_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 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() and SSL_is_quic() functions were added in OpenSSL 3.2. ✨

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