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 SSL_CTX_set_tlsext_servername_callback() sets the application callback B<cb>
23 used by a server to perform any actions or configuration required based on
24 the servername extension received in the incoming connection. When B<cb>
25 is NULL, SNI is not used. The B<arg> value is a pointer which is passed to
26 the application callback.
28 SSL_CTX_set_tlsext_servername_arg() sets a context-specific argument to be
29 passed into the callback for this B<SSL_CTX>.
31 SSL_get_servername() returns a servername extension value of the specified
32 type if provided in the Client Hello or NULL.
34 SSL_get_servername_type() returns the servername type or -1 if no servername
35 is present. Currently the only supported type (defined in RFC3546) is
36 B<TLSEXT_NAMETYPE_host_name>.
40 The ALPN and SNI callbacks are both executed during Client Hello processing.
41 The servername callback is executed first, followed by the ALPN callback.
45 SSL_CTX_set_tlsext_servername_callback() and
46 SSL_CTX_set_tlsext_servername_arg() both always return 1 indicating success.
50 L<ssl(7)>, L<SSL_CTX_set_alpn_select_cb(3)>,
51 L<SSL_get0_alpn_selected(3)>
55 Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
57 Licensed under the OpenSSL license (the "License"). You may not use
58 this file except in compliance with the License. You can obtain a copy
59 in the file LICENSE in the source distribution or at
60 L<https://www.openssl.org/source/license.html>.