diff options
author | emboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-15 01:10:26 +0000 |
---|---|---|
committer | emboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-08-15 01:10:26 +0000 |
commit | 1be5789eed8de583662e47e2bf580bf14a9e296c (patch) | |
tree | 169a0170ad0ef0f27fbaae66a067ee5d77265761 | |
parent | 63ad065026a60caf5b032712a269b427ad6ae15a (diff) | |
download | ruby-1be5789eed8de583662e47e2bf580bf14a9e296c.tar.gz |
* ext/openssl/ossl_ssl.c: Support disabling OpenSSL compression.
* test/openssl/test_ssl.rb: Add a test for it.
Thanks to Eric Wong for the patch.
[Ruby 1.9 - Feature #5183] [ruby-core:38911]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ext/openssl/ossl_ssl.c | 3 | ||||
-rw-r--r-- | test/openssl/test_ssl.rb | 9 |
3 files changed, 19 insertions, 0 deletions
@@ -1,3 +1,10 @@ +Mon Aug 15 09:58:55 2011 Martin Bosslet <Martin.Bosslet@googlemail.com> + + * ext/openssl/ossl_ssl.c: Support disabling OpenSSL compression. + * test/openssl/test_ssl.rb: Add a test for it. + Thanks to Eric Wong for the patch. + [Ruby 1.9 - Feature #5183] [ruby-core:38911] + Sun Aug 14 05:57:01 2011 Tanaka Akira <akr@fsij.org> * test/socket/test_socket.rb (test_connect_timeout): added a test diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index ed820cd431..3769633468 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -1997,6 +1997,9 @@ Init_ossl_ssl() #if defined(SSL_OP_NO_TICKET) ossl_ssl_def_const(OP_NO_TICKET); #endif +#if defined(SSL_OP_NO_COMPRESSION) + ossl_ssl_def_const(OP_NO_COMPRESSION); +#endif ossl_ssl_def_const(OP_PKCS1_CHECK_1); ossl_ssl_def_const(OP_PKCS1_CHECK_2); ossl_ssl_def_const(OP_NETSCAPE_CA_DN_BUG); diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index 07154eac01..a081931bce 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -9,6 +9,15 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase assert_equal(ctx.setup, nil) end + def test_ctx_setup_no_compression + ctx = OpenSSL::SSL::SSLContext.new + ctx.options = OpenSSL::SSL::OP_ALL | OpenSSL::SSL::OP_NO_COMPRESSION + assert_equal(ctx.setup, true) + assert_equal(ctx.setup, nil) + assert_equal(OpenSSL::SSL::OP_NO_COMPRESSION, + ctx.options & OpenSSL::SSL::OP_NO_COMPRESSION) + end if defined?(OpenSSL::SSL::OP_NO_COMPRESSION) + def test_not_started_session skip "non socket argument of SSLSocket.new is not supported on this platform" if /mswin|mingw/ =~ RUBY_PLATFORM open(__FILE__) do |f| |