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