1SSL_CTX_set_tlsext_servername_callbacOkpS(eS3nL)S_SCLTX_set_tlsext_servername_callback(3)
2
3
4

NAME

6       SSL_CTX_set_tlsext_servername_callback,
7       SSL_CTX_set_tlsext_servername_arg, SSL_get_servername_type,
8       SSL_get_servername - handle server name indication (SNI)
9

SYNOPSIS

11        #include <openssl/ssl.h>
12
13        long SSL_CTX_set_tlsext_servername_callback(SSL_CTX *ctx,
14                                          int (*cb)(SSL *, int *, void *));
15        long SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg);
16
17        const char *SSL_get_servername(const SSL *s, const int type);
18        int SSL_get_servername_type(const SSL *s);
19

DESCRIPTION

21       SSL_CTX_set_tlsext_servername_callback() sets the application callback
22       cb used by a server to perform any actions or configuration required
23       based on the servername extension received in the incoming connection.
24       When cb is NULL, SNI is not used. The arg value is a pointer which is
25       passed to the application callback.
26
27       SSL_CTX_set_tlsext_servername_arg() sets a context-specific argument to
28       be passed into the callback for this SSL_CTX.
29
30       SSL_get_servername() returns a servername extension value of the
31       specified type if provided in the Client Hello or NULL.
32
33       SSL_get_servername_type() returns the servername type or -1 if no
34       servername is present. Currently the only supported type (defined in
35       RFC3546) is TLSEXT_NAMETYPE_host_name.
36

NOTES

38       The ALPN and SNI callbacks are both executed during Client Hello
39       processing.  The servername callback is executed first, followed by the
40       ALPN callback.
41

RETURN VALUES

43       SSL_CTX_set_tlsext_servername_callback() and
44       SSL_CTX_set_tlsext_servername_arg() both always return 1 indicating
45       success.
46

SEE ALSO

48       ssl(7), SSL_CTX_set_alpn_select_cb(3), SSL_get0_alpn_selected(3)
49
51       Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
52
53       Licensed under the OpenSSL license (the "License").  You may not use
54       this file except in compliance with the License.  You can obtain a copy
55       in the file LICENSE in the source distribution or at
56       <https://www.openssl.org/source/license.html>.
57
58
59
601.0.2o                            2020S-S0L1_-C2T8X_set_tlsext_servername_callback(3)
Impressum