Update version docs
[openssl.git] / doc / man3 / SSL_get_version.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_client_version, SSL_get_version, SSL_is_dtls, SSL_version - get the
6 protocol information of a connection
7
8 =head1 SYNOPSIS
9
10  #include <openssl/ssl.h>
11
12  int SSL_client_version(const SSL *s);
13
14  const char *SSL_get_version(const SSL *ssl);
15
16  int SSL_is_dtls(const SSL *ssl);
17
18  int SSL_version(const SSL *s);
19
20 =head1 DESCRIPTION
21
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
27 unreliable.
28
29 SSL_is_dtls() returns one if the connection is using DTLS, zero if not.
30
31 =head1 RETURN VALUES
32
33 SSL_get_version() returns one of the following strings:
34
35 =over 4
36
37 =item SSLv3
38
39 The connection uses the SSLv3 protocol.
40
41 =item TLSv1
42
43 The connection uses the TLSv1.0 protocol.
44
45 =item TLSv1.1
46
47 The connection uses the TLSv1.1 protocol.
48
49 =item TLSv1.2
50
51 The connection uses the TLSv1.2 protocol.
52
53 =item TLSv1.3
54
55 The connection uses the TLSv1.3 protocol.
56
57 =item unknown
58
59 This indicates an unknown protocol version.
60
61 =back
62
63 SSL_version() and SSL_client_version() return an integer which could include any of
64 the following:
65
66 =over 4
67
68 =item SSL3_VERSION
69
70 The connection uses the SSLv3 protocol.
71
72 =item TLS1_VERSION
73
74 The connection uses the TLSv1.0 protocol.
75
76 =item TLS1_1_VERSION
77
78 The connection uses the TLSv1.1 protocol.
79
80 =item TLS1_2_VERSION
81
82 The connection uses the TLSv1.2 protocol.
83
84 =item TLS1_3_VERSION
85
86 The connection uses the TLSv1.3 protocol.
87
88 =back
89
90 =head1 SEE ALSO
91
92 L<ssl(7)>
93
94 =head1 HISTORY
95
96 SSL_is_dtls() was added in OpenSSL 1.1.0.
97
98 =head1 COPYRIGHT
99
100 Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
101
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>.
106
107 =cut