5 SSL_SESSION_get0_hostname,
6 SSL_SESSION_set1_hostname,
7 SSL_SESSION_get0_alpn_selected,
8 SSL_SESSION_set1_alpn_selected
9 - get and set SNI and ALPN data ssociated with a session
13 #include <openssl/ssl.h>
15 const char *SSL_SESSION_get0_hostname(const SSL_SESSION *s);
16 int SSL_SESSION_set1_hostname(SSL_SESSION *s, const char *hostname);
18 void SSL_SESSION_get0_alpn_selected(const SSL_SESSION *s,
19 const unsigned char **alpn,
21 int SSL_SESSION_set1_alpn_selected(SSL_SESSION *s, const unsigned char *alpn,
26 SSL_SESSION_get0_hostname() retrieves the SNI value that was sent by the
27 client when the session was created, or NULL if no value was sent.
29 The value returned is a pointer to memory maintained within B<s> and
32 SSL_SESSION_set1_hostname() sets the SNI value for the hostname to a copy of
33 the string provided in hostname.
35 SSL_SESSION_get0_alpn_selected() retrieves the selected ALPN protocol for this
36 session and its associated length in bytes. The returned value of B<*alpn> is a
37 pointer to memory maintained within B<s> and should not be free'd.
39 SSL_SESSION_set1_alpn_selected() sets the ALPN protocol for this session to the
40 value in B<*alpn> which should be of length B<len> bytes. A copy of this value
46 L<d2i_SSL_SESSION(3)>,
47 L<SSL_SESSION_get_time(3)>,
48 L<SSL_SESSION_free(3)>
52 SSL_SESSION_set1_hostname(), SSL_SESSION_get0_alpn_selected() and
53 SSL_SESSION_set1_alpn_selected() were added in OpenSSL 1.1.1.
57 Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
59 Licensed under the OpenSSL license (the "License"). You may not use
60 this file except in compliance with the License. You can obtain a copy
61 in the file LICENSE in the source distribution or at
62 L<https://www.openssl.org/source/license.html>.