doc/man3: unindent a few unintended code blocks
[openssl.git] / doc / man3 / SSL_CTX_set_tlsext_servername_callback.pod
1 =pod
2
3 =head1 NAME
4
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
7 (SNI)
8
9 =head1 SYNOPSIS
10
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
20 =head1 DESCRIPTION
21
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.
25
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.
31
32 SSL_CTX_set_tlsext_servername_arg() sets a context-specific argument to be
33 passed into the callback for this B<SSL_CTX>.
34
35 SSL_get_servername() returns a servername extension value of the specified
36 type if provided in the Client Hello or NULL.
37
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>.
41
42 =head1 NOTES
43
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.
47
48 =head1 RETURN VALUES
49
50 SSL_CTX_set_tlsext_servername_callback() and
51 SSL_CTX_set_tlsext_servername_arg() both always return 1 indicating success.
52
53 =head1 SEE ALSO
54
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)>
57
58 =head1 COPYRIGHT
59
60 Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
61
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>.
66
67 =cut