1SSL_SESSION_GET0_HOSTNAME(3)        OpenSSL       SSL_SESSION_GET0_HOSTNAME(3)
2
3
4

NAME

6       SSL_SESSION_get0_hostname, SSL_SESSION_set1_hostname,
7       SSL_SESSION_get0_alpn_selected, SSL_SESSION_set1_alpn_selected - get
8       and set SNI and ALPN data ssociated with a session
9

SYNOPSIS

11        #include <openssl/ssl.h>
12
13        const char *SSL_SESSION_get0_hostname(const SSL_SESSION *s);
14        int SSL_SESSION_set1_hostname(SSL_SESSION *s, const char *hostname);
15
16        void SSL_SESSION_get0_alpn_selected(const SSL_SESSION *s,
17                                            const unsigned char **alpn,
18                                            size_t *len);
19        int SSL_SESSION_set1_alpn_selected(SSL_SESSION *s, const unsigned char *alpn,
20                                           size_t len);
21

DESCRIPTION

23       SSL_SESSION_get0_hostname() retrieves the SNI value that was sent by
24       the client when the session was created, or NULL if no value was sent.
25
26       The value returned is a pointer to memory maintained within s and
27       should not be free'd.
28
29       SSL_SESSION_set1_hostname() sets the SNI value for the hostname to a
30       copy of the string provided in hostname.
31
32       SSL_SESSION_get0_alpn_selected() retrieves the selected ALPN protocol
33       for this session and its associated length in bytes. The returned value
34       of *alpn is a pointer to memory maintained within s and should not be
35       free'd.
36
37       SSL_SESSION_set1_alpn_selected() sets the ALPN protocol for this
38       session to the value in alpn which should be of length len bytes. A
39       copy of the input value is made, and the caller retains ownership of
40       the memory pointed to by alpn.
41

RETURN VALUES

43       SSL_SESSION_get0_hostname() returns either a string or NULL based on if
44       there is the SNI value sent by client.
45
46       SSL_SESSION_set1_hostname() returns 1 on success or 0 on error.
47
48       SSL_SESSION_set1_alpn_selected() returns 1 on success or 0 on error.
49

SEE ALSO

51       ssl(7), d2i_SSL_SESSION(3), SSL_SESSION_get_time(3),
52       SSL_SESSION_free(3)
53

HISTORY

55       The SSL_SESSION_set1_hostname(), SSL_SESSION_get0_alpn_selected() and
56       SSL_SESSION_set1_alpn_selected() functions were added in OpenSSL 1.1.1.
57
59       Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
60
61       Licensed under the OpenSSL license (the "License").  You may not use
62       this file except in compliance with the License.  You can obtain a copy
63       in the file LICENSE in the source distribution or at
64       <https://www.openssl.org/source/license.html>.
65
66
67
681.1.1c                            2019-05-28      SSL_SESSION_GET0_HOSTNAME(3)
Impressum