@@ -140,7 +140,6 @@ ossl_sslctx_s_alloc(VALUE klass)
140
140
ossl_raise (eSSLError , "SSL_CTX_new:" );
141
141
}
142
142
SSL_CTX_set_mode (ctx , SSL_MODE_ENABLE_PARTIAL_WRITE );
143
- SSL_CTX_set_options (ctx , SSL_OP_ALL );
144
143
return Data_Wrap_Struct (klass , 0 , ossl_sslctx_free , ctx );
145
144
}
146
145
@@ -560,7 +559,11 @@ ossl_sslctx_setup(VALUE self)
560
559
if (!NIL_P (val )) SSL_CTX_set_verify_depth (ctx , NUM2LONG (val ));
561
560
562
561
val = ossl_sslctx_get_options (self );
563
- if (!NIL_P (val )) SSL_CTX_set_options (ctx , NUM2LONG (val ));
562
+ if (!NIL_P (val )) {
563
+ SSL_CTX_set_options (ctx , NUM2LONG (val ));
564
+ } else {
565
+ SSL_CTX_set_options (ctx , SSL_OP_ALL );
566
+ }
564
567
rb_obj_freeze (self );
565
568
566
569
val = ossl_sslctx_get_sess_id_ctx (self );
@@ -1441,18 +1444,20 @@ Init_ossl_ssl()
1441
1444
ossl_ssl_def_const (VERIFY_PEER );
1442
1445
ossl_ssl_def_const (VERIFY_FAIL_IF_NO_PEER_CERT );
1443
1446
ossl_ssl_def_const (VERIFY_CLIENT_ONCE );
1444
- /* Not introduce constants included in OP_ALL such as...
1445
- * ossl_ssl_def_const(OP_MICROSOFT_SESS_ID_BUG);
1446
- * ossl_ssl_def_const(OP_NETSCAPE_CHALLENGE_BUG);
1447
- * ossl_ssl_def_const(OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG);
1448
- * ossl_ssl_def_const(OP_SSLREF2_REUSE_CERT_TYPE_BUG);
1449
- * ossl_ssl_def_const(OP_MICROSOFT_BIG_SSLV3_BUFFER);
1450
- * ossl_ssl_def_const(OP_MSIE_SSLV2_RSA_PADDING);
1451
- * ossl_ssl_def_const(OP_SSLEAY_080_CLIENT_DH_BUG);
1452
- * ossl_ssl_def_const(OP_TLS_D5_BUG);
1453
- * ossl_ssl_def_const(OP_TLS_BLOCK_PADDING_BUG);
1454
- * ossl_ssl_def_const(OP_DONT_INSERT_EMPTY_FRAGMENTS);
1447
+ /* Introduce constants included in OP_ALL. These constants are mostly for
1448
+ * unset some bits in OP_ALL such as;
1449
+ * ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS
1455
1450
*/
1451
+ ossl_ssl_def_const (OP_MICROSOFT_SESS_ID_BUG );
1452
+ ossl_ssl_def_const (OP_NETSCAPE_CHALLENGE_BUG );
1453
+ ossl_ssl_def_const (OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG );
1454
+ ossl_ssl_def_const (OP_SSLREF2_REUSE_CERT_TYPE_BUG );
1455
+ ossl_ssl_def_const (OP_MICROSOFT_BIG_SSLV3_BUFFER );
1456
+ ossl_ssl_def_const (OP_MSIE_SSLV2_RSA_PADDING );
1457
+ ossl_ssl_def_const (OP_SSLEAY_080_CLIENT_DH_BUG );
1458
+ ossl_ssl_def_const (OP_TLS_D5_BUG );
1459
+ ossl_ssl_def_const (OP_TLS_BLOCK_PADDING_BUG );
1460
+ ossl_ssl_def_const (OP_DONT_INSERT_EMPTY_FRAGMENTS );
1456
1461
ossl_ssl_def_const (OP_ALL );
1457
1462
#if defined(SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION )
1458
1463
ossl_ssl_def_const (OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION );
0 commit comments