SSL_CTX_set_options.pod revision 72613
172613Skris=pod 272613Skris 372613Skris=head1 NAME 472613Skris 572613SkrisSSL_CTX_set_options, SSL_set_options, SSL_CTX_get_options, SSL_get_options - manipulate SSL engine options 672613Skris 772613Skris=head1 SYNOPSIS 872613Skris 972613Skris #include <openssl/ssl.h> 1072613Skris 1172613Skris long SSL_CTX_set_options(SSL_CTX *ctx, long options); 1272613Skris long SSL_set_options(SSL *ssl, long options); 1372613Skris 1472613Skris long SSL_CTX_get_options(SSL_CTX *ctx); 1572613Skris long SSL_get_options(SSL *ssl); 1672613Skris 1772613Skris=head1 DESCRIPTION 1872613Skris 1972613SkrisSSL_CTX_set_options() adds the options set via bitmask in B<options> to B<ctx>. 2072613SkrisOptions already set before are not cleared. 2172613Skris 2272613SkrisSSL_set_options() adds the options set via bitmask in B<options> to B<ssl>. 2372613SkrisOptions already set before are not cleared. 2472613Skris 2572613SkrisSSL_CTX_get_options() returns the options set for B<ctx>. 2672613Skris 2772613SkrisSSL_get_options() returns the options set for B<ssl>. 2872613Skris 2972613Skris=head1 NOTES 3072613Skris 3172613SkrisThe behaviour of the SSL library can be changed by setting several options. 3272613SkrisThe options are coded as bitmasks and can be combined by a logical B<or> 3372613Skrisoperation (|). Options can only be added but can never be reset. 3472613Skris 3572613SkrisDuring a handshake, the option settings of the SSL object used. When 3672613Skrisa new SSL object is created from a context using SSL_new(), the current 3772613Skrisoption setting is copied. Changes to B<ctx> do not affect already created 3872613SkrisSSL objects. SSL_clear() does not affect the settings. 3972613Skris 4072613SkrisThe following B<bug workaround> options are available: 4172613Skris 4272613Skris=over 4 4372613Skris 4472613Skris=item SSL_OP_MICROSOFT_SESS_ID_BUG 4572613Skris 4672613Skriswww.microsoft.com - when talking SSLv2, if session-id reuse is 4772613Skrisperformed, the session-id passed back in the server-finished message 4872613Skrisis different from the one decided upon. 4972613Skris 5072613Skris=item SSL_OP_NETSCAPE_CHALLENGE_BUG 5172613Skris 5272613SkrisNetscape-Commerce/1.12, when talking SSLv2, accepts a 32 byte 5372613Skrischallenge but then appears to only use 16 bytes when generating the 5472613Skrisencryption keys. Using 16 bytes is ok but it should be ok to use 32. 5572613SkrisAccording to the SSLv3 spec, one should use 32 bytes for the challenge 5672613Skriswhen opperating in SSLv2/v3 compatablity mode, but as mentioned above, 5772613Skristhis breaks this server so 16 bytes is the way to go. 5872613Skris 5972613Skris=item SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 6072613Skris 6172613Skrisssl3.netscape.com:443, first a connection is established with RC4-MD5. 6272613SkrisIf it is then resumed, we end up using DES-CBC3-SHA. It should be 6372613SkrisRC4-MD5 according to 7.6.1.3, 'cipher_suite'. 6472613Skris 6572613SkrisNetscape-Enterprise/2.01 (https://merchant.netscape.com) has this bug. 6672613SkrisIt only really shows up when connecting via SSLv2/v3 then reconnecting 6772613Skrisvia SSLv3. The cipher list changes.... 6872613Skris 6972613SkrisNEW INFORMATION. Try connecting with a cipher list of just 7072613SkrisDES-CBC-SHA:RC4-MD5. For some weird reason, each new connection uses 7172613SkrisRC4-MD5, but a re-connect tries to use DES-CBC-SHA. So netscape, when 7272613Skrisdoing a re-connect, always takes the first cipher in the cipher list. 7372613Skris 7472613Skris=item SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 7572613Skris 7672613Skris... 7772613Skris 7872613Skris=item SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 7972613Skris 8072613Skris... 8172613Skris 8272613Skris=item SSL_OP_MSIE_SSLV2_RSA_PADDING 8372613Skris 8472613Skris... 8572613Skris 8672613Skris=item SSL_OP_SSLEAY_080_CLIENT_DH_BUG 8772613Skris 8872613Skris... 8972613Skris 9072613Skris=item SSL_OP_TLS_D5_BUG 9172613Skris 9272613Skris... 9372613Skris 9472613Skris=item SSL_OP_TLS_BLOCK_PADDING_BUG 9572613Skris 9672613Skris... 9772613Skris 9872613Skris=item SSL_OP_TLS_ROLLBACK_BUG 9972613Skris 10072613SkrisDisable version rollback attack detection. 10172613Skris 10272613SkrisDuring the client key exchange, the client must send the same information 10372613Skrisabout acceptable SSL/TLS protocol levels as during the first hello. Some 10472613Skrisclients violate this rule by adapting to the server's answer. (Example: 10572613Skristhe client sends a SSLv2 hello and accepts up to SSLv3.1=TLSv1, the server 10672613Skrisonly understands up to SSLv3. In this case the client must still use the 10772613Skrissame SSLv3.1=TLSv1 announcement. Some clients step down to SSLv3 with respect 10872613Skristo the server's answer and violate the version rollback protection.) 10972613Skris 11072613Skris=item SSL_OP_ALL 11172613Skris 11272613SkrisAll of the above bug workarounds. 11372613Skris 11472613Skris=back 11572613Skris 11672613SkrisIt is save and recommended to use SSL_OP_ALL to enable the bug workaround 11772613Skrisoptions. 11872613Skris 11972613SkrisThe following B<modifying> options are available: 12072613Skris 12172613Skris=over 4 12272613Skris 12372613Skris=item SSL_OP_SINGLE_DH_USE 12472613Skris 12572613SkrisAlways create a new key when using temporary DH parameters. 12672613Skris 12772613Skris=item SSL_OP_EPHEMERAL_RSA 12872613Skris 12972613SkrisAlso use the temporary RSA key when doing RSA operations. 13072613Skris 13172613Skris=item SSL_OP_PKCS1_CHECK_1 13272613Skris 13372613Skris... 13472613Skris 13572613Skris=item SSL_OP_PKCS1_CHECK_2 13672613Skris 13772613Skris... 13872613Skris 13972613Skris=item SSL_OP_NETSCAPE_CA_DN_BUG 14072613Skris 14172613SkrisIf we accept a netscape connection, demand a client cert, have a 14272613Skrisnon-self-sighed CA which does not have it's CA in netscape, and the 14372613Skrisbrowser has a cert, it will crash/hang. Works for 3.x and 4.xbeta 14472613Skris 14572613Skris=item SSL_OP_NON_EXPORT_FIRST 14672613Skris 14772613SkrisOn servers try to use non-export (stronger) ciphers first. This option does 14872613Skrisnot work under all circumstances (in the code it is declared "broken"). 14972613Skris 15072613Skris=item SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 15172613Skris 15272613Skris... 15372613Skris 15472613Skris=item SSL_OP_NO_SSLv2 15572613Skris 15672613SkrisDo not use the SSLv2 protocol. 15772613Skris 15872613Skris=item SSL_OP_NO_SSLv3 15972613Skris 16072613SkrisDo not use the SSLv3 protocol. 16172613Skris 16272613Skris=item SSL_OP_NO_TLSv1 16372613Skris 16472613SkrisDo not use the TLSv1 protocol. 16572613Skris 16672613Skris=back 16772613Skris 16872613Skris=head1 RETURN VALUES 16972613Skris 17072613SkrisSSL_CTX_set_options() and SSL_set_options() return the new options bitmask 17172613Skrisafter adding B<options>. 17272613Skris 17372613SkrisSSL_CTX_get_options() and SSL_get_options() return the current bitmask. 17472613Skris 17572613Skris=head1 SEE ALSO 17672613Skris 17772613SkrisL<ssl(3)|ssl(3)>, L<SSL_new(3)|SSL_new(3)>, L<SSL_clear(3)|SSL_clear(3)> 17872613Skris 17972613Skris=head1 HISTORY 18072613Skris 18172613SkrisSSL_OP_TLS_ROLLBACK_BUG has been added in OpenSSL 0.9.6. 18272613Skris 18372613Skris=cut 184