SSL_GET_VERSION(3ossl)

πŸ“¦ version 15.1, in freebsd 15.1

πŸ’… 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() β€” returns 1 if the connection is using DTLS, 0 if not.
  • SSL_is_tls() β€” returns 1 if the connection is using SSL/TLS, 0 if not.
  • SSL_is_quic() β€” returns 1 if the connection is using QUIC, 0 if 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 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 it, iykyk ✨


🌈 HISTORY 🌈

  • SSL_is_dtls() was added in OpenSSL 1.1.0.
  • SSL_is_tls() and SSL_is_quic() 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, slay πŸ’… this was version 3.5.6, dated 2026-04-07 β€” go forth and check ur protocol versions, periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from