Merge from vendor branch LIBEVENT:
[dragonfly.git] / secure / lib / libssl / man / SSL_CTX_set_options.3
1 .\" Automatically generated by Pod::Man 2.12 (Pod::Simple 3.05)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
29 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
30 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
31 .\" nothing in troff, for use with C<>.
32 .tr \(*W-
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
65 .    \" fudge factors for nroff and troff
66 .if n \{\
67 .    ds #H 0
68 .    ds #V .8m
69 .    ds #F .3m
70 .    ds #[ \f1
71 .    ds #] \fP
72 .\}
73 .if t \{\
74 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75 .    ds #V .6m
76 .    ds #F 0
77 .    ds #[ \&
78 .    ds #] \&
79 .\}
80 .    \" simple accents for nroff and troff
81 .if n \{\
82 .    ds ' \&
83 .    ds ` \&
84 .    ds ^ \&
85 .    ds , \&
86 .    ds ~ ~
87 .    ds /
88 .\}
89 .if t \{\
90 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96 .\}
97 .    \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 .    \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 .    \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
112 \{\
113 .    ds : e
114 .    ds 8 ss
115 .    ds o a
116 .    ds d- d\h'-1'\(ga
117 .    ds D- D\h'-1'\(hy
118 .    ds th \o'bp'
119 .    ds Th \o'LP'
120 .    ds ae ae
121 .    ds Ae AE
122 .\}
123 .rm #[ #] #H #V #F C
124 .\" ========================================================================
125 .\"
126 .IX Title "SSL_CTX_set_options 3"
127 .TH SSL_CTX_set_options 3 "2007-10-24" "0.9.8g" "OpenSSL"
128 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
130 .if n .ad l
131 .nh
132 .SH "NAME"
133 SSL_CTX_set_options, SSL_set_options, SSL_CTX_get_options, SSL_get_options \- manipulate SSL engine options
134 .SH "SYNOPSIS"
135 .IX Header "SYNOPSIS"
136 .Vb 1
137 \& #include <openssl/ssl.h>
138 \&
139 \& long SSL_CTX_set_options(SSL_CTX *ctx, long options);
140 \& long SSL_set_options(SSL *ssl, long options);
141 \&
142 \& long SSL_CTX_get_options(SSL_CTX *ctx);
143 \& long SSL_get_options(SSL *ssl);
144 .Ve
145 .SH "DESCRIPTION"
146 .IX Header "DESCRIPTION"
147 \&\fISSL_CTX_set_options()\fR adds the options set via bitmask in \fBoptions\fR to \fBctx\fR.
148 Options already set before are not cleared!
149 .PP
150 \&\fISSL_set_options()\fR adds the options set via bitmask in \fBoptions\fR to \fBssl\fR.
151 Options already set before are not cleared!
152 .PP
153 \&\fISSL_CTX_get_options()\fR returns the options set for \fBctx\fR.
154 .PP
155 \&\fISSL_get_options()\fR returns the options set for \fBssl\fR.
156 .SH "NOTES"
157 .IX Header "NOTES"
158 The behaviour of the \s-1SSL\s0 library can be changed by setting several options.
159 The options are coded as bitmasks and can be combined by a logical \fBor\fR
160 operation (|). Options can only be added but can never be reset.
161 .PP
162 \&\fISSL_CTX_set_options()\fR and \fISSL_set_options()\fR affect the (external)
163 protocol behaviour of the \s-1SSL\s0 library. The (internal) behaviour of
164 the \s-1API\s0 can be changed by using the similar
165 \&\fISSL_CTX_set_mode\fR\|(3) and \fISSL_set_mode()\fR functions.
166 .PP
167 During a handshake, the option settings of the \s-1SSL\s0 object are used. When
168 a new \s-1SSL\s0 object is created from a context using \fISSL_new()\fR, the current
169 option setting is copied. Changes to \fBctx\fR do not affect already created
170 \&\s-1SSL\s0 objects. \fISSL_clear()\fR does not affect the settings.
171 .PP
172 The following \fBbug workaround\fR options are available:
173 .IP "\s-1SSL_OP_MICROSOFT_SESS_ID_BUG\s0" 4
174 .IX Item "SSL_OP_MICROSOFT_SESS_ID_BUG"
175 www.microsoft.com \- when talking SSLv2, if session-id reuse is
176 performed, the session-id passed back in the server-finished message
177 is different from the one decided upon.
178 .IP "\s-1SSL_OP_NETSCAPE_CHALLENGE_BUG\s0" 4
179 .IX Item "SSL_OP_NETSCAPE_CHALLENGE_BUG"
180 Netscape\-Commerce/1.12, when talking SSLv2, accepts a 32 byte
181 challenge but then appears to only use 16 bytes when generating the
182 encryption keys.  Using 16 bytes is ok but it should be ok to use 32.
183 According to the SSLv3 spec, one should use 32 bytes for the challenge
184 when operating in SSLv2/v3 compatibility mode, but as mentioned above,
185 this breaks this server so 16 bytes is the way to go.
186 .IP "\s-1SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG\s0" 4
187 .IX Item "SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG"
188 ssl3.netscape.com:443, first a connection is established with \s-1RC4\-MD5\s0.
189 If it is then resumed, we end up using \s-1DES\-CBC3\-SHA\s0.  It should be
190 \&\s-1RC4\-MD5\s0 according to 7.6.1.3, 'cipher_suite'.
191 .Sp
192 Netscape\-Enterprise/2.01 (https://merchant.netscape.com) has this bug.
193 It only really shows up when connecting via SSLv2/v3 then reconnecting
194 via SSLv3. The cipher list changes....
195 .Sp
196 \&\s-1NEW\s0 \s-1INFORMATION\s0.  Try connecting with a cipher list of just
197 \&\s-1DES\-CBC\-SHA:RC4\-MD5\s0.  For some weird reason, each new connection uses
198 \&\s-1RC4\-MD5\s0, but a re-connect tries to use DES-CBC-SHA.  So netscape, when
199 doing a re-connect, always takes the first cipher in the cipher list.
200 .IP "\s-1SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG\s0" 4
201 .IX Item "SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG"
202 \&...
203 .IP "\s-1SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER\s0" 4
204 .IX Item "SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER"
205 \&...
206 .IP "\s-1SSL_OP_MSIE_SSLV2_RSA_PADDING\s0" 4
207 .IX Item "SSL_OP_MSIE_SSLV2_RSA_PADDING"
208 As of OpenSSL 0.9.7h and 0.9.8a, this option has no effect.
209 .IP "\s-1SSL_OP_SSLEAY_080_CLIENT_DH_BUG\s0" 4
210 .IX Item "SSL_OP_SSLEAY_080_CLIENT_DH_BUG"
211 \&...
212 .IP "\s-1SSL_OP_TLS_D5_BUG\s0" 4
213 .IX Item "SSL_OP_TLS_D5_BUG"
214 \&...
215 .IP "\s-1SSL_OP_TLS_BLOCK_PADDING_BUG\s0" 4
216 .IX Item "SSL_OP_TLS_BLOCK_PADDING_BUG"
217 \&...
218 .IP "\s-1SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS\s0" 4
219 .IX Item "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS"
220 Disables a countermeasure against a \s-1SSL\s0 3.0/TLS 1.0 protocol
221 vulnerability affecting \s-1CBC\s0 ciphers, which cannot be handled by some
222 broken \s-1SSL\s0 implementations.  This option has no effect for connections
223 using other ciphers.
224 .IP "\s-1SSL_OP_ALL\s0" 4
225 .IX Item "SSL_OP_ALL"
226 All of the above bug workarounds.
227 .PP
228 It is usually safe to use \fB\s-1SSL_OP_ALL\s0\fR to enable the bug workaround
229 options if compatibility with somewhat broken implementations is
230 desired.
231 .PP
232 The following \fBmodifying\fR options are available:
233 .IP "\s-1SSL_OP_TLS_ROLLBACK_BUG\s0" 4
234 .IX Item "SSL_OP_TLS_ROLLBACK_BUG"
235 Disable version rollback attack detection.
236 .Sp
237 During the client key exchange, the client must send the same information
238 about acceptable \s-1SSL/TLS\s0 protocol levels as during the first hello. Some
239 clients violate this rule by adapting to the server's answer. (Example:
240 the client sends a SSLv2 hello and accepts up to SSLv3.1=TLSv1, the server
241 only understands up to SSLv3. In this case the client must still use the
242 same SSLv3.1=TLSv1 announcement. Some clients step down to SSLv3 with respect
243 to the server's answer and violate the version rollback protection.)
244 .IP "\s-1SSL_OP_SINGLE_DH_USE\s0" 4
245 .IX Item "SSL_OP_SINGLE_DH_USE"
246 Always create a new key when using temporary/ephemeral \s-1DH\s0 parameters
247 (see \fISSL_CTX_set_tmp_dh_callback\fR\|(3)).
248 This option must be used to prevent small subgroup attacks, when
249 the \s-1DH\s0 parameters were not generated using \*(L"strong\*(R" primes
250 (e.g. when using DSA-parameters, see \fIdhparam\fR\|(1)).
251 If \*(L"strong\*(R" primes were used, it is not strictly necessary to generate
252 a new \s-1DH\s0 key during each handshake but it is also recommended.
253 \&\fB\s-1SSL_OP_SINGLE_DH_USE\s0\fR should therefore be enabled whenever
254 temporary/ephemeral \s-1DH\s0 parameters are used.
255 .IP "\s-1SSL_OP_EPHEMERAL_RSA\s0" 4
256 .IX Item "SSL_OP_EPHEMERAL_RSA"
257 Always use ephemeral (temporary) \s-1RSA\s0 key when doing \s-1RSA\s0 operations
258 (see \fISSL_CTX_set_tmp_rsa_callback\fR\|(3)).
259 According to the specifications this is only done, when a \s-1RSA\s0 key
260 can only be used for signature operations (namely under export ciphers
261 with restricted \s-1RSA\s0 keylength). By setting this option, ephemeral
262 \&\s-1RSA\s0 keys are always used. This option breaks compatibility with the
263 \&\s-1SSL/TLS\s0 specifications and may lead to interoperability problems with
264 clients and should therefore never be used. Ciphers with \s-1EDH\s0 (ephemeral
265 Diffie-Hellman) key exchange should be used instead.
266 .IP "\s-1SSL_OP_CIPHER_SERVER_PREFERENCE\s0" 4
267 .IX Item "SSL_OP_CIPHER_SERVER_PREFERENCE"
268 When choosing a cipher, use the server's preferences instead of the client
269 preferences. When not set, the \s-1SSL\s0 server will always follow the clients
270 preferences. When set, the SSLv3/TLSv1 server will choose following its
271 own preferences. Because of the different protocol, for SSLv2 the server
272 will send its list of preferences to the client and the client chooses.
273 .IP "\s-1SSL_OP_PKCS1_CHECK_1\s0" 4
274 .IX Item "SSL_OP_PKCS1_CHECK_1"
275 \&...
276 .IP "\s-1SSL_OP_PKCS1_CHECK_2\s0" 4
277 .IX Item "SSL_OP_PKCS1_CHECK_2"
278 \&...
279 .IP "\s-1SSL_OP_NETSCAPE_CA_DN_BUG\s0" 4
280 .IX Item "SSL_OP_NETSCAPE_CA_DN_BUG"
281 If we accept a netscape connection, demand a client cert, have a
282 non-self-signed \s-1CA\s0 which does not have its \s-1CA\s0 in netscape, and the
283 browser has a cert, it will crash/hang.  Works for 3.x and 4.xbeta
284 .IP "\s-1SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG\s0" 4
285 .IX Item "SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG"
286 \&...
287 .IP "SSL_OP_NO_SSLv2" 4
288 .IX Item "SSL_OP_NO_SSLv2"
289 Do not use the SSLv2 protocol.
290 .IP "SSL_OP_NO_SSLv3" 4
291 .IX Item "SSL_OP_NO_SSLv3"
292 Do not use the SSLv3 protocol.
293 .IP "SSL_OP_NO_TLSv1" 4
294 .IX Item "SSL_OP_NO_TLSv1"
295 Do not use the TLSv1 protocol.
296 .IP "\s-1SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION\s0" 4
297 .IX Item "SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION"
298 When performing renegotiation as a server, always start a new session
299 (i.e., session resumption requests are only accepted in the initial
300 handshake).  This option is not needed for clients.
301 .IP "\s-1SSL_OP_NO_TICKET\s0" 4
302 .IX Item "SSL_OP_NO_TICKET"
303 Normally clients and servers will, where possible, transparently make use
304 of RFC4507bis tickets for stateless session resumption if extension support
305 is explicitly set when OpenSSL is compiled.
306 .Sp
307 If this option is set this functionality is disabled and tickets will
308 not be used by clients or servers.
309 .SH "RETURN VALUES"
310 .IX Header "RETURN VALUES"
311 \&\fISSL_CTX_set_options()\fR and \fISSL_set_options()\fR return the new options bitmask
312 after adding \fBoptions\fR.
313 .PP
314 \&\fISSL_CTX_get_options()\fR and \fISSL_get_options()\fR return the current bitmask.
315 .SH "SEE ALSO"
316 .IX Header "SEE ALSO"
317 \&\fIssl\fR\|(3), \fISSL_new\fR\|(3), \fISSL_clear\fR\|(3),
318 \&\fISSL_CTX_set_tmp_dh_callback\fR\|(3),
319 \&\fISSL_CTX_set_tmp_rsa_callback\fR\|(3),
320 \&\fIdhparam\fR\|(1)
321 .SH "HISTORY"
322 .IX Header "HISTORY"
323 \&\fB\s-1SSL_OP_CIPHER_SERVER_PREFERENCE\s0\fR and
324 \&\fB\s-1SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION\s0\fR have been added in
325 OpenSSL 0.9.7.
326 .PP
327 \&\fB\s-1SSL_OP_TLS_ROLLBACK_BUG\s0\fR has been added in OpenSSL 0.9.6 and was automatically
328 enabled with \fB\s-1SSL_OP_ALL\s0\fR. As of 0.9.7, it is no longer included in \fB\s-1SSL_OP_ALL\s0\fR
329 and must be explicitly set.
330 .PP
331 \&\fB\s-1SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS\s0\fR has been added in OpenSSL 0.9.6e.
332 Versions up to OpenSSL 0.9.6c do not include the countermeasure that
333 can be disabled with this option (in OpenSSL 0.9.6d, it was always
334 enabled).