5 SSL_CTX_set_tlsext_servername_callback, SSL_CTX_set_tlsext_servername_arg,
6 SSL_get_servername_type, SSL_get_servername - handle server name indication
11 #include <openssl/ssl.h>
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);
17 const char *SSL_get_servername(const SSL *s, const int type);
18 int SSL_get_servername_type(const SSL *s);
22 The functionality provided by the servername callback is superseded by
23 the early callback, which can be set using SSL_CTX_set_early_cb().
24 The servername callback is retained for historical compatibility.
26 SSL_CTX_set_tlsext_servername_callback() sets the application callback B<cb>
27 used by a server to perform any actions or configuration required based on
28 the servername extension received in the incoming connection. When B<cb>
29 is NULL, SNI is not used. The B<arg> value is a pointer which is passed to
30 the application callback.
32 SSL_CTX_set_tlsext_servername_arg() sets a context-specific argument to be
33 passed into the callback for this B<SSL_CTX>.
35 SSL_get_servername() returns a servername extension value of the specified
36 type if provided in the Client Hello or NULL.
38 SSL_get_servername_type() returns the servername type or -1 if no servername
39 is present. Currently the only supported type (defined in RFC3546) is
40 B<TLSEXT_NAMETYPE_host_name>.
44 Several callbacks are executed during ClientHello processing, including
45 the early, ALPN, and servername callbacks. The early callback is executed
46 first, then the servername callback, followed by the ALPN callback.
50 SSL_CTX_set_tlsext_servername_callback() and
51 SSL_CTX_set_tlsext_servername_arg() both always return 1 indicating success.
55 L<ssl(7)>, L<SSL_CTX_set_alpn_select_cb(3)>,
56 L<SSL_get0_alpn_selected(3)>, L<SSL_CTX_set_early_cb(3)>
60 Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
62 Licensed under the OpenSSL license (the "License"). You may not use
63 this file except in compliance with the License. You can obtain a copy
64 in the file LICENSE in the source distribution or at
65 L<https://www.openssl.org/source/license.html>.