SSL_GET_VERSION(3)

NAME
SSL_get_version, SSL_version - get the protocol version of a connection

SYNOPSIS
#include <openssl/ssl.h>
const char *
SSL_get_version(const SSL *ssl);
int
SSL_version(const SSL *ssl);

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

SSL_version() returns an integer constant representing that protocol.

RETURN VALUES
The following strings or integers can be returned:

"TLSv1" or TLS1_VERSION
    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.

"DTLSv1" or DTLS1_VERSION
    The connection uses the Datagram Transport Layer Security 1.0 protocol.

"unknown"
    This indicates that no version has been set (no connection established).

SEE ALSO
ssl(3)

HISTORY
SSL_get_version() and SSL_version() appeared before SSLeay 0.8 and have been available since OpenBSD 2.4.