Document the i2o and o2i SCT functions
[openssl.git] / doc / ssl / SSL_CTX_use_serverinfo.pod
1 =pod
2
3 =head1 NAME
4
5 SSL_CTX_use_serverinfo, SSL_CTX_use_serverinfo_file - use serverinfo extension
6
7 =head1 SYNOPSIS
8
9  #include <openssl/ssl.h>
10
11  int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
12                             size_t serverinfo_length);
13
14  int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
15
16 =head1 DESCRIPTION
17
18 These functions load "serverinfo" TLS ServerHello Extensions into the SSL_CTX.
19 A "serverinfo" extension is returned in response to an empty ClientHello
20 Extension.
21
22 SSL_CTX_use_serverinfo() loads one or more serverinfo extensions from
23 a byte array into B<ctx>.  The extensions must be concatenated into a
24 sequence of bytes.  Each extension must consist of a 2-byte Extension Type,
25 a 2-byte length, and then length bytes of extension_data.
26
27 SSL_CTX_use_serverinfo_file() loads one or more serverinfo extensions from
28 B<file> into B<ctx>.  The extensions must be in PEM format.  Each extension
29 must consist of a 2-byte Extension Type, a 2-byte length, and then length
30 bytes of extension_data.  Each PEM extension name must begin with the phrase
31 "BEGIN SERVERINFO FOR ".
32
33 If more than one certificate (RSA/DSA) is installed using
34 SSL_CTX_use_certificate(), the serverinfo extension will be loaded into the
35 last certificate installed.  If e.g. the last item was a RSA certificate, the
36 loaded serverinfo extension data will be loaded for that certificate.  To
37 use the serverinfo extension for multiple certificates,
38 SSL_CTX_use_serverinfo() needs to be called multiple times, once B<after>
39 each time a certificate is loaded.
40
41 =head1 RETURN VALUES
42
43 On success, the functions return 1.
44 On failure, the functions return 0.  Check out the error stack to find out
45 the reason.
46
47 =head1 COPYRIGHT
48
49 Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved.
50
51 Licensed under the OpenSSL license (the "License").  You may not use
52 this file except in compliance with the License.  You can obtain a copy
53 in the file LICENSE in the source distribution or at
54 L<https://www.openssl.org/source/license.html>.
55
56 =cut