Debian Codegraph @

upstream/debian-unstable/man3/SSL_CTX_use_serverinfo.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "SSL_CTX_USE_SERVERINFO 3SSL"
58 .TH SSL_CTX_USE_SERVERINFO 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 SSL_CTX_use_serverinfo_ex,
65 SSL_CTX_use_serverinfo,
66 SSL_CTX_use_serverinfo_file
67 \&\- use serverinfo extension
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& #include <openssl/ssl.h>
72 \&
73 \& int SSL_CTX_use_serverinfo_ex(SSL_CTX *ctx, unsigned int version,
74 \& const unsigned char *serverinfo,
75 \& size_t serverinfo_length);
76 \&
77 \& int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
78 \& size_t serverinfo_length);
79 \&
80 \& int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);
81 .Ve
82 .SH DESCRIPTION
83 .IX Header "DESCRIPTION"
84 These functions load "serverinfo" TLS extensions into the SSL_CTX. A
85 "serverinfo" extension is returned in response to an empty ClientHello
86 Extension.
87 .PP
88 \&\fBSSL_CTX_use_serverinfo_ex()\fR loads one or more serverinfo extensions from
89 a byte array into \fBctx\fR. The \fBversion\fR parameter specifies the format of the
90 byte array provided in \fB*serverinfo\fR which is of length \fBserverinfo_length\fR.
91 .PP
92 If \fBversion\fR is \fBSSL_SERVERINFOV2\fR then the extensions in the array must
93 consist of a 4\-byte context, a 2\-byte Extension Type, a 2\-byte length, and then
94 length bytes of extension_data. The context and type values have the same
95 meaning as for \fBSSL_CTX_add_custom_ext\fR\|(3). If serverinfo is being loaded for
96 extensions to be added to a Certificate message, then the extension will only
97 be added for the first certificate in the message (which is always the
98 end-entity certificate).
99 .PP
100 If \fBversion\fR is \fBSSL_SERVERINFOV1\fR then the extensions in the array must
101 consist of a 2\-byte Extension Type, a 2\-byte length, and then length bytes of
102 extension_data. The type value has the same meaning as for
103 \&\fBSSL_CTX_add_custom_ext\fR\|(3). The following default context value will be used
104 in this case:
105 .PP
106 .Vb 2
107 \& SSL_EXT_TLS1_2_AND_BELOW_ONLY | SSL_EXT_CLIENT_HELLO
108 \& | SSL_EXT_TLS1_2_SERVER_HELLO | SSL_EXT_IGNORE_ON_RESUMPTION
109 .Ve
110 .PP
111 \&\fBSSL_CTX_use_serverinfo()\fR does the same thing as \fBSSL_CTX_use_serverinfo_ex()\fR
112 except that there is no \fBversion\fR parameter so a default version of
113 SSL_SERVERINFOV1 is used instead.
114 .PP
115 \&\fBSSL_CTX_use_serverinfo_file()\fR loads one or more serverinfo extensions from
116 \&\fBfile\fR into \fBctx\fR. The extensions must be in PEM format. Each extension
117 must be in a format as described above for \fBSSL_CTX_use_serverinfo_ex()\fR. Each
118 PEM extension name must begin with the phrase "BEGIN SERVERINFOV2 FOR " for
119 SSL_SERVERINFOV2 data or "BEGIN SERVERINFO FOR " for SSL_SERVERINFOV1 data.
120 .PP
121 If more than one certificate (RSA/DSA) is installed using
122 \&\fBSSL_CTX_use_certificate()\fR, the serverinfo extension will be loaded into the
123 last certificate installed. If e.g. the last item was an RSA certificate, the
124 loaded serverinfo extension data will be loaded for that certificate. To
125 use the serverinfo extension for multiple certificates,
126 \&\fBSSL_CTX_use_serverinfo()\fR needs to be called multiple times, once \fBafter\fR
127 each time a certificate is loaded via a call to \fBSSL_CTX_use_certificate()\fR.
128 .SH "RETURN VALUES"
129 .IX Header "RETURN VALUES"
130 On success, the functions return 1.
131 On failure, the functions return 0. Check out the error stack to find out
132 the reason.
133 .SH "SEE ALSO"
134 .IX Header "SEE ALSO"
135 \&\fBssl\fR\|(7)
136 .SH COPYRIGHT
137 .IX Header "COPYRIGHT"
138 Copyright 2013\-2017 The OpenSSL Project Authors. All Rights Reserved.
139 .PP
140 Licensed under the Apache License 2.0 (the "License"). You may not use
141 this file except in compliance with the License. You can obtain a copy
142 in the file LICENSE in the source distribution or at
143 <https://www.openssl.org/source/license.html>.