1 =pod 2 3 =head1 NAME 4 5 SSL_SESSION_get_protocol_version, 6 SSL_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 18 SSL_SESSION_get_protocol_version() returns the protocol version number used 19 by session B<s>. 20 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 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>, B<TLS1_2_VERSION> or B<TLS1_3_VERSION>. 31 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. 34 35 SSL_SESSION_set_protocol_version() returns 1 on success or 0 on failure. 36 37 =head1 SEE ALSO 38 39 L<ssl(7)>, 40 L<SSL_CTX_set_psk_use_session_callback(3)> 41 42 =head1 HISTORY 43 44 The SSL_SESSION_get_protocol_version() function was added in OpenSSL 1.1.0. 45 The SSL_SESSION_set_protocol_version() function was added in OpenSSL 1.1.1. 46 47 =head1 COPYRIGHT 48 49 Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. 50 51 Licensed under the Apache License 2.0 (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 57