1=pod
2
3=head1 NAME
4
5SSL_SESSION_get_protocol_version,
6SSL_SESSION_set_protocol_version
7- get and set the session protocol version
8
9=head1 SYNOPSIS
10
11 #include <openssl/ssl.h>
12
13 int SSL_SESSION_get_protocol_version(const SSL_SESSION *s);
14 int SSL_SESSION_set_protocol_version(SSL_SESSION *s, int version);
15
16=head1 DESCRIPTION
17
18SSL_SESSION_get_protocol_version() returns the protocol version number used
19by session B<s>.
20
21SSL_SESSION_set_protocol_version() sets the protocol version associated with the
22SSL_SESSION object B<s> to the value B<version>. This value should be a version
23constant such as B<TLS1_3_VERSION> etc. For example, this could be used to set
24up a session based PSK (see L<SSL_CTX_set_psk_use_session_callback(3)>).
25
26=head1 RETURN VALUES
27
28SSL_SESSION_get_protocol_version() returns a number indicating the protocol
29version used for the session; this number matches the constants I<e.g.>
30B<TLS1_VERSION>, B<TLS1_2_VERSION> or B<TLS1_3_VERSION>.
31
32Note that the SSL_SESSION_get_protocol_version() function
33does B<not> perform a null check on the provided session B<s> pointer.
34
35SSL_SESSION_set_protocol_version() returns 1 on success or 0 on failure.
36
37=head1 SEE ALSO
38
39L<ssl(7)>,
40L<SSL_CTX_set_psk_use_session_callback(3)>
41
42=head1 HISTORY
43
44The SSL_SESSION_get_protocol_version() function was added in OpenSSL 1.1.0.
45The SSL_SESSION_set_protocol_version() function was added in OpenSSL 1.1.1.
46
47=head1 COPYRIGHT
48
49Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
50
51Licensed under the Apache License 2.0 (the "License").  You may not use
52this file except in compliance with the License.  You can obtain a copy
53in the file LICENSE in the source distribution or at
54L<https://www.openssl.org/source/license.html>.
55
56=cut
57