Manual Page Search Parameters

SSL_GET_VERSION(3) Library Functions Manual SSL_GET_VERSION(3)

SSL_get_version, SSL_version
get the protocol version of a connection

#include <openssl/ssl.h>

const char *
SSL_get_version(const SSL *ssl);

SSL_version(const SSL *ssl);

SSL_get_version() returns the name of the protocol used for the connection ssl.

SSL_version() returns an integer constant representing that protocol.

These functions only return reliable results after the initial handshake has been completed.

The following strings or integers can be returned:
The connection uses the TLSv1.0 protocol.
“TLSv1.1” or TLS1_1_VERSION
The connection uses the TLSv1.1 protocol.
“TLSv1.2” or TLS1_2_VERSION
The connection uses the TLSv1.2 protocol.
“TLSv1.3” or TLS1_3_VERSION
The connection uses the TLSv1.3 protocol.
The connection uses the Datagram Transport Layer Security 1.0 protocol.
This indicates an unknown protocol version; it cannot currently happen with LibreSSL.


SSL_get_version() and SSL_version() first appeared in SSLeay 0.8.0 and have been available since OpenBSD 2.4.
March 18, 2019 OpenBSD-current