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