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