summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_CTX_set_options.3
diff options
context:
space:
mode:
authorbentley <>2014-10-12 09:33:04 +0000
committerbentley <>2014-10-12 09:33:04 +0000
commit82b7f378b6907ab315a6e50322d2a0a8794a0aa9 (patch)
treea5087bf8d016a6041c2b6822fbecfd8f6c5e70b1 /src/lib/libssl/doc/SSL_CTX_set_options.3
parent0a63f0cf49369e1926567ab62e04e3355cedf0cd (diff)
downloadopenbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.tar.gz
openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.tar.bz2
openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.zip
Convert libssl manpages from pod to mdoc(7).
libcrypto has not been started yet. ok schwarze@ miod@
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_options.3')
-rw-r--r--src/lib/libssl/doc/SSL_CTX_set_options.3384
1 files changed, 384 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_options.3 b/src/lib/libssl/doc/SSL_CTX_set_options.3
new file mode 100644
index 0000000000..8b2f75cc59
--- /dev/null
+++ b/src/lib/libssl/doc/SSL_CTX_set_options.3
@@ -0,0 +1,384 @@
1.Dd $Mdocdate: October 12 2014 $
2.Dt SSL_CTX_SET_OPTIONS 3
3.Os
4.Sh NAME
5.Nm SSL_CTX_set_options ,
6.Nm SSL_set_options ,
7.Nm SSL_CTX_clear_options ,
8.Nm SSL_clear_options ,
9.Nm SSL_CTX_get_options ,
10.Nm SSL_get_options ,
11.Nm SSL_get_secure_renegotiation_support
12.Nd manipulate SSL options
13.Sh SYNOPSIS
14.In openssl/ssl.h
15.Ft long
16.Fn SSL_CTX_set_options "SSL_CTX *ctx" "long options"
17.Ft long
18.Fn SSL_set_options "SSL *ssl" "long options"
19.Ft long
20.Fn SSL_CTX_clear_options "SSL_CTX *ctx" "long options"
21.Ft long
22.Fn SSL_clear_options "SSL *ssl" "long options"
23.Ft long
24.Fn SSL_CTX_get_options "SSL_CTX *ctx"
25.Ft long
26.Fn SSL_get_options "SSL *ssl"
27.Ft long
28.Fn SSL_get_secure_renegotiation_support "SSL *ssl"
29.Sh DESCRIPTION
30Note: all these functions are implemented using macros.
31.Pp
32.Fn SSL_CTX_set_options
33adds the options set via bitmask in
34.Fa options
35to
36.Fa ctx .
37Options already set before are not cleared!
38.Pp
39.Fn SSL_set_options
40adds the options set via bitmask in
41.Fa options
42to
43.Fa ssl .
44Options already set before are not cleared!
45.Pp
46.Fn SSL_CTX_clear_options
47clears the options set via bitmask in
48.Fa options
49to
50.Fa ctx .
51.Pp
52.Fn SSL_clear_options
53clears the options set via bitmask in
54.Fa options
55to
56.Fa ssl .
57.Pp
58.Fn SSL_CTX_get_options
59returns the options set for
60.Fa ctx .
61.Pp
62.Fn SSL_get_options
63returns the options set for
64.Fa ssl .
65.Pp
66.Fn SSL_get_secure_renegotiation_support
67indicates whether the peer supports secure renegotiation.
68.Sh NOTES
69The behaviour of the SSL library can be changed by setting several options.
70The options are coded as bitmasks and can be combined by a bitwise OR
71operation (|).
72.Pp
73.Fn SSL_CTX_set_options
74and
75.Fn SSL_set_options
76affect the (external) protocol behaviour of the SSL library.
77The (internal) behaviour of the API can be changed by using the similar
78.Xr SSL_CTX_set_mode 3
79and
80.Xr SSL_set_mode 3
81functions.
82.Pp
83During a handshake, the option settings of the SSL object are used.
84When a new SSL object is created from a context using
85.Xr SSL_new 3 ,
86the current option setting is copied.
87Changes to
88.Fa ctx
89do not affect already created
90.Vt SSL
91objects.
92.Fn SSL_clear
93does not affect the settings.
94.Pp
95The following
96.Em bug workaround
97options are available:
98.Bl -tag -width Ds
99.It Dv SSL_OP_MICROSOFT_SESS_ID_BUG
100.Lk www.microsoft.com
101\(en when talking SSLv2, if session-id reuse is performed,
102the session-id passed back in the server-finished message is different from the
103one decided upon.
104.It Dv SSL_OP_NETSCAPE_CHALLENGE_BUG
105Netscape-Commerce/1.12, when talking SSLv2, accepts a 32 byte challenge but
106then appears to only use 16 bytes when generating the encryption keys.
107Using 16 bytes is ok but it should be ok to use 32.
108According to the SSLv3 spec, one should use 32 bytes for the challenge when
109operating in SSLv2/v3 compatibility mode, but as mentioned above, this breaks
110this server so 16 bytes is the way to go.
111.It Dv SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
112As of OpenSSL 0.9.8q and 1.0.0c, this option has no effect.
113.It Dv SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
114\&...
115.It Dv SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
116\&...
117.It Dv SSL_OP_SAFARI_ECDHE_ECDSA_BUG
118Don't prefer ECDHE-ECDSA ciphers when the client appears to be Safari on OS X.
119OS X 10.8..10.8.3 has broken support for ECDHE-ECDSA ciphers.
120.It Dv SSL_OP_SSLEAY_080_CLIENT_DH_BUG
121\&...
122.It Dv SSL_OP_TLS_D5_BUG
123\&...
124.It Dv SSL_OP_TLS_BLOCK_PADDING_BUG
125\&...
126.It Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
127Disables a countermeasure against a SSL 3.0/TLS 1.0 protocol vulnerability
128affecting CBC ciphers, which cannot be handled by some broken SSL
129implementations.
130This option has no effect for connections using other ciphers.
131.It Dv SSL_OP_TLSEXT_PADDING
132Adds a padding extension to ensure the ClientHello size is never between 256
133and 511 bytes in length.
134This is needed as a workaround for some implementations.
135.It Dv SSL_OP_ALL
136All of the above bug workarounds.
137.El
138.Pp
139It is usually safe to use
140.Dv SSL_OP_ALL
141to enable the bug workaround options if compatibility with somewhat broken
142implementations is desired.
143.Pp
144The following
145.Em modifying
146options are available:
147.Bl -tag -width Ds
148.It Dv SSL_OP_TLS_ROLLBACK_BUG
149Disable version rollback attack detection.
150.Pp
151During the client key exchange, the client must send the same information
152about acceptable SSL/TLS protocol levels as during the first hello.
153Some clients violate this rule by adapting to the server's answer.
154(Example: the client sends a SSLv2 hello and accepts up to SSLv3.1=TLSv1,
155the server only understands up to SSLv3.
156In this case the client must still use the same SSLv3.1=TLSv1 announcement.
157Some clients step down to SSLv3 with respect to the server's answer and violate
158the version rollback protection.)
159.It Dv SSL_OP_SINGLE_DH_USE
160Always create a new key when using temporary/ephemeral DH parameters
161(see
162.Xr SSL_CTX_set_tmp_dh_callback 3 ) .
163This option must be used to prevent small subgroup attacks, when the DH
164parameters were not generated using
165.Dq strong
166primes (e.g., when using DSA-parameters, see
167.Xr dhparam 1 ) .
168If
169.Dq strong
170primes were used, it is not strictly necessary to generate a new DH key during
171each handshake but it is also recommended.
172.Dv SSL_OP_SINGLE_DH_USE
173should therefore be enabled whenever temporary/ephemeral DH parameters are used.
174.It SSL_OP_EPHEMERAL_RSA
175Always use ephemeral (temporary) RSA key when doing RSA operations (see
176.Xr SSL_CTX_set_tmp_rsa_callback 3 ) .
177According to the specifications, this is only done when a RSA key can only be
178used for signature operations (namely under export ciphers with restricted RSA
179keylength).
180By setting this option, ephemeral RSA keys are always used.
181This option breaks compatibility with the SSL/TLS specifications and may lead
182to interoperability problems with clients and should therefore never be used.
183Ciphers with EDH (ephemeral Diffie-Hellman) key exchange should be used instead.
184.It Dv SSL_OP_CIPHER_SERVER_PREFERENCE
185When choosing a cipher, use the server's preferences instead of the client
186preferences.
187When not set, the SSL server will always follow the client's preferences.
188When set, the SSLv3/TLSv1 server will choose following its own preferences.
189Because of the different protocol, for SSLv2 the server will send its list of
190preferences to the client and the client chooses.
191.It Dv SSL_OP_NETSCAPE_CA_DN_BUG
192If we accept a netscape connection, demand a client cert, have a
193non-self-signed CA which does not have its CA in netscape, and the browser has
194a cert, it will crash/hang.
195Works for 3.x and 4.xbeta
196.It Dv SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
197\&...
198.It Dv SSL_OP_NO_SSLv2
199As of
200.Ox 5.6 ,
201this option has no effect as SSLv2 support has been removed.
202In previous versions it disabled use of the SSLv2 protocol.
203.It Dv SSL_OP_NO_SSLv3
204Do not use the SSLv3 protocol.
205.It Dv SSL_OP_NO_TLSv1
206Do not use the TLSv1.0 protocol.
207.It Dv SSL_OP_NO_TLSv1_1
208Do not use the TLSv1.1 protocol.
209.It Dv SSL_OP_NO_TLSv1_2
210Do not use the TLSv1.2 protocol.
211.It Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
212When performing renegotiation as a server, always start a new session (i.e.,
213session resumption requests are only accepted in the initial handshake).
214This option is not needed for clients.
215.It Dv SSL_OP_NO_TICKET
216Normally clients and servers will, where possible, transparently make use of
217RFC4507bis tickets for stateless session resumption.
218.Pp
219If this option is set this functionality is disabled and tickets will not be
220used by clients or servers.
221.It Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
222As of
223.Ox 5.6 ,
224this option has no effect.
225In previous versions it allowed legacy insecure renegotiation between OpenSSL
226and unpatched clients or servers.
227See the
228.Sx SECURE RENEGOTIATION
229section for more details.
230.It Dv SSL_OP_LEGACY_SERVER_CONNECT
231Allow legacy insecure renegotiation between OpenSSL and unpatched servers
232.Em only :
233this option is currently set by default.
234See the
235.Sx SECURE RENEGOTIATION
236section for more details.
237.El
238.Sh SECURE RENEGOTIATION
239OpenSSL 0.9.8m and later always attempts to use secure renegotiation as
240described in RFC5746.
241This counters the prefix attack described in CVE-2009-3555 and elsewhere.
242.Pp
243The deprecated and highly broken SSLv2 protocol does not support renegotiation
244at all; its use is
245.Em strongly
246discouraged.
247.Pp
248This attack has far-reaching consequences which application writers should be
249aware of.
250In the description below an implementation supporting secure renegotiation is
251referred to as
252.Dq patched .
253A server not supporting secure
254renegotiation is referred to as
255.Dq unpatched .
256.Pp
257The following sections describe the operations permitted by OpenSSL's secure
258renegotiation implementation.
259.Ss Patched client and server
260Connections and renegotiation are always permitted by OpenSSL implementations.
261.Ss Unpatched client and patched OpenSSL server
262The initial connection succeeds but client renegotiation is denied by the
263server with a
264.Em no_renegotiation
265warning alert if TLS v1.0 is used or a fatal
266.Em handshake_failure
267alert in SSL v3.0.
268.Pp
269If the patched OpenSSL server attempts to renegotiate a fatal
270.Em handshake_failure
271alert is sent.
272This is because the server code may be unaware of the unpatched nature of the
273client.
274.Pp
275.Em N.B.:
276a bug in OpenSSL clients earlier than 0.9.8m (all of which are unpatched) will
277result in the connection hanging if it receives a
278.Em no_renegotiation
279alert.
280OpenSSL versions 0.9.8m and later will regard a
281.Em no_renegotiation
282alert as fatal and respond with a fatal
283.Em handshake_failure
284alert.
285This is because the OpenSSL API currently has no provision to indicate to an
286application that a renegotiation attempt was refused.
287.Ss Patched OpenSSL client and unpatched server
288If the option
289.Dv SSL_OP_LEGACY_SERVER_CONNECT
290is set then initial connections and renegotiation between patched OpenSSL
291clients and unpatched servers succeeds.
292If neither option is set then initial connections to unpatched servers will
293fail.
294.Pp
295The option
296.Dv SSL_OP_LEGACY_SERVER_CONNECT
297is currently set by default even though it has security implications:
298otherwise it would be impossible to connect to unpatched servers (i.e., all of
299them initially) and this is clearly not acceptable.
300Renegotiation is permitted because this does not add any additional security
301issues: during an attack clients do not see any renegotiations anyway.
302.Pp
303As more servers become patched the option
304.Dv SSL_OP_LEGACY_SERVER_CONNECT
305will
306.Em not
307be set by default in a future version of OpenSSL.
308.Pp
309OpenSSL client applications wishing to ensure they can connect to unpatched
310servers should always
311.Em set
312.Dv SSL_OP_LEGACY_SERVER_CONNECT
313.Pp
314OpenSSL client applications that want to ensure they can
315.Em not
316connect to unpatched servers (and thus avoid any security issues) should always
317.Em clear
318.Dv SSL_OP_LEGACY_SERVER_CONNECT
319using
320.Fn SSL_CTX_clear_options
321or
322.Fn SSL_clear_options .
323.Sh RETURN VALUES
324.Fn SSL_CTX_set_options
325and
326.Fn SSL_set_options
327return the new options bitmask after adding
328.Fa options .
329.Pp
330.Fn SSL_CTX_clear_options
331and
332.Fn SSL_clear_options
333return the new options bitmask after clearing
334.Fa options .
335.Pp
336.Fn SSL_CTX_get_options
337and
338.Fn SSL_get_options
339return the current bitmask.
340.Pp
341.Fn SSL_get_secure_renegotiation_support
342returns 1 is the peer supports secure renegotiation and 0 if it does not.
343.Sh SEE ALSO
344.Xr dhparam 1 ,
345.Xr ssl 3 ,
346.Xr SSL_clear 3 ,
347.Xr SSL_CTX_set_tmp_dh_callback 3 ,
348.Xr SSL_CTX_set_tmp_rsa_callback 3 ,
349.Xr SSL_new 3
350.Sh HISTORY
351.Dv SSL_OP_CIPHER_SERVER_PREFERENCE
352and
353.Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
354have been added in
355OpenSSL 0.9.7.
356.Pp
357.Dv SSL_OP_TLS_ROLLBACK_BUG
358has been added in OpenSSL 0.9.6 and was automatically enabled with
359.Dv SSL_OP_ALL .
360As of 0.9.7, it is no longer included in
361.Dv SSL_OP_ALL
362and must be explicitly set.
363.Pp
364.Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
365has been added in OpenSSL 0.9.6e.
366Versions up to OpenSSL 0.9.6c do not include the countermeasure that can be
367disabled with this option (in OpenSSL 0.9.6d, it was always enabled).
368.Pp
369.Fn SSL_CTX_clear_options
370and
371.Fn SSL_clear_options
372were first added in OpenSSL 0.9.8m.
373.Pp
374.Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION ,
375.Dv SSL_OP_LEGACY_SERVER_CONNECT
376and the function
377.Fn SSL_get_secure_renegotiation_support
378were first added in OpenSSL 0.9.8m.
379.Pp
380.Dv SSL_OP_NO_SSLv2
381and
382.Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
383were changed to have no effect in
384.Ox 5.6 .