Blame doc/man3/SSL_CTX_use_serverinfo.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SSL_CTX_use_serverinfo_ex,
Packit c4476c
SSL_CTX_use_serverinfo,
Packit c4476c
SSL_CTX_use_serverinfo_file
Packit c4476c
- use serverinfo extension
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ssl.h>
Packit c4476c
Packit c4476c
 int SSL_CTX_use_serverinfo_ex(SSL_CTX *ctx, unsigned int version,
Packit c4476c
                               const unsigned char *serverinfo,
Packit c4476c
                               size_t serverinfo_length);
Packit c4476c
Packit c4476c
 int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
Packit c4476c
                            size_t serverinfo_length);
Packit c4476c
Packit c4476c
 int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
These functions load "serverinfo" TLS extensions into the SSL_CTX. A
Packit c4476c
"serverinfo" extension is returned in response to an empty ClientHello
Packit c4476c
Extension.
Packit c4476c
Packit c4476c
SSL_CTX_use_serverinfo_ex() loads one or more serverinfo extensions from
Packit c4476c
a byte array into B<ctx>. The B<version> parameter specifies the format of the
Packit c4476c
byte array provided in B<*serverinfo> which is of length B<serverinfo_length>.
Packit c4476c
Packit c4476c
If B<version> is B<SSL_SERVERINFOV2> then the extensions in the array must
Packit c4476c
consist of a 4-byte context, a 2-byte Extension Type, a 2-byte length, and then
Packit c4476c
length bytes of extension_data. The context and type values have the same
Packit c4476c
meaning as for L<SSL_CTX_add_custom_ext(3)>. If serverinfo is being loaded for
Packit c4476c
extensions to be added to a Certificate message, then the extension will only
Packit c4476c
be added for the first certificate in the message (which is always the
Packit c4476c
end-entity certificate).
Packit c4476c
Packit c4476c
If B<version> is B<SSL_SERVERINFOV1> then the extensions in the array must
Packit c4476c
consist of a 2-byte Extension Type, a 2-byte length, and then length bytes of
Packit c4476c
extension_data. The type value has the same meaning as for
Packit c4476c
L<SSL_CTX_add_custom_ext(3)>. The following default context value will be used
Packit c4476c
in this case:
Packit c4476c
Packit c4476c
 SSL_EXT_TLS1_2_AND_BELOW_ONLY | SSL_EXT_CLIENT_HELLO
Packit c4476c
 | SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_IGNORE_ON_RESUMPTION
Packit c4476c
Packit c4476c
SSL_CTX_use_serverinfo() does the same thing as SSL_CTX_use_serverinfo_ex()
Packit c4476c
except that there is no B<version> parameter so a default version of
Packit c4476c
SSL_SERVERINFOV1 is used instead.
Packit c4476c
Packit c4476c
SSL_CTX_use_serverinfo_file() loads one or more serverinfo extensions from
Packit c4476c
B<file> into B<ctx>.  The extensions must be in PEM format.  Each extension
Packit c4476c
must be in a format as described above for SSL_CTX_use_serverinfo_ex().  Each
Packit c4476c
PEM extension name must begin with the phrase "BEGIN SERVERINFOV2 FOR " for
Packit c4476c
SSL_SERVERINFOV2 data or "BEGIN SERVERINFO FOR " for SSL_SERVERINFOV1 data.
Packit c4476c
Packit c4476c
If more than one certificate (RSA/DSA) is installed using
Packit c4476c
SSL_CTX_use_certificate(), the serverinfo extension will be loaded into the
Packit c4476c
last certificate installed.  If e.g. the last item was a RSA certificate, the
Packit c4476c
loaded serverinfo extension data will be loaded for that certificate.  To
Packit c4476c
use the serverinfo extension for multiple certificates,
Packit c4476c
SSL_CTX_use_serverinfo() needs to be called multiple times, once B<after>
Packit c4476c
each time a certificate is loaded via a call to SSL_CTX_use_certificate().
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
On success, the functions return 1.
Packit c4476c
On failure, the functions return 0.  Check out the error stack to find out
Packit c4476c
the reason.
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut