5 SSL_client_version, SSL_get_version, SSL_is_dtls, SSL_version - get the
6 protocol information of a connection
10 #include <openssl/ssl.h>
12 int SSL_client_version(const SSL *s);
14 const char *SSL_get_version(const SSL *ssl);
16 int SSL_is_dtls(const SSL *ssl);
18 int SSL_version(const SSL *s);
22 SSL_client_version() returns the protocol version used by the client when
23 initiating the connection. SSL_get_version() returns the name of the protocol
24 used for the connection. SSL_version() returns the protocol version used for the
25 connection. They should only be called after the initial handshake has been
26 completed. Prior to that the results returned from these functions may be
29 SSL_is_dtls() returns one if the connection is using DTLS, zero if not.
33 SSL_get_version() returns one of the following strings:
39 The connection uses the SSLv3 protocol.
43 The connection uses the TLSv1.0 protocol.
47 The connection uses the TLSv1.1 protocol.
51 The connection uses the TLSv1.2 protocol.
55 The connection uses the TLSv1.3 protocol.
59 This indicates an unknown protocol version.
63 SSL_version() and SSL_client_version() return an integer which could include any of
70 The connection uses the SSLv3 protocol.
74 The connection uses the TLSv1.0 protocol.
78 The connection uses the TLSv1.1 protocol.
82 The connection uses the TLSv1.2 protocol.
86 The connection uses the TLSv1.3 protocol.
96 SSL_is_dtls() was added in OpenSSL 1.1.0.
100 Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
102 Licensed under the OpenSSL license (the "License"). You may not use
103 this file except in compliance with the License. You can obtain a copy
104 in the file LICENSE in the source distribution or at
105 L<https://www.openssl.org/source/license.html>.