blob: 22e40bd6436cf424413c0ab07859e32a0e4bfa75 [file] [log] [blame]
TJ Saundersbd01f642016-05-26 15:40:13 -07001=pod
2
3=head1 NAME
4
Matt Caswell267869d2017-06-14 13:58:29 +01005SSL_SESSION_get_protocol_version,
6SSL_SESSION_set_protocol_version
7- get and set the session protocol version
TJ Saundersbd01f642016-05-26 15:40:13 -07008
9=head1 SYNOPSIS
10
11 #include <openssl/ssl.h>
12
13 int SSL_SESSION_get_protocol_version(const SSL_SESSION *s);
Matt Caswell267869d2017-06-14 13:58:29 +010014 int SSL_SESSION_set_protocol_version(SSL_SESSION *s, int version);
TJ Saundersbd01f642016-05-26 15:40:13 -070015
16=head1 DESCRIPTION
17
TJ Saunders73271292016-05-27 10:22:17 -070018SSL_SESSION_get_protocol_version() returns the protocol version number used
19by session B<s>.
TJ Saundersbd01f642016-05-26 15:40:13 -070020
Matt Caswell267869d2017-06-14 13:58:29 +010021SSL_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
TJ Saundersbd01f642016-05-26 15:40:13 -070026=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> or B<TLS1_2_VERSION>.
31
TJ Saunders80c630f2016-05-31 14:09:17 -070032Note that the SSL_SESSION_get_protocol_version() function
33does B<not> perform a null check on the provided session B<s> pointer.
TJ Saundersbd01f642016-05-26 15:40:13 -070034
Matt Caswell267869d2017-06-14 13:58:29 +010035SSL_SESSION_set_protocol_version() returns 1 on success or 0 on failure.
36
TJ Saundersbd01f642016-05-26 15:40:13 -070037=head1 SEE ALSO
38
Matt Caswell267869d2017-06-14 13:58:29 +010039L<ssl(7)>,
40L<SSL_CTX_set_psk_use_session_callback(3)>
TJ Saunders73271292016-05-27 10:22:17 -070041
42=head1 HISTORY
43
Matt Caswell267869d2017-06-14 13:58:29 +010044SSL_SESSION_get_protocol_version() was first added to OpenSSL 1.1.0.
45SSL_SESSION_set_protocol_version() was first added to OpenSSL 1.1.1.
TJ Saundersbd01f642016-05-26 15:40:13 -070046
47=head1 COPYRIGHT
48
Matt Caswell267869d2017-06-14 13:58:29 +010049Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
TJ Saundersbd01f642016-05-26 15:40:13 -070050
51Licensed under the OpenSSL license (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