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