diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ext/openssl/lib/openssl/ssl.rb | 2 | ||||
-rw-r--r-- | test/openssl/test_ssl.rb | 4 |
3 files changed, 14 insertions, 3 deletions
@@ -1,3 +1,14 @@ +Wed Aug 19 23:59:28 2015 Aaron Patterson <tenderlove@ruby-lang.org> + + * ext/openssl/lib/openssl/ssl.rb (module OpenSSL): add OP_ALL to + existing options rather than just setting it. Some vendors apply + custom patches to their versions of OpenSSL that set default values + for options. This commit respects the custom patches they've + applied. + + * test/openssl/test_ssl.rb (class OpenSSL): check that OP_ALL has been + added to the options. + Wed Aug 19 23:55:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> * process.c (rb_f_spawn): [DOC] elaborate environment variable diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb index 03d0ebeef2..631943cc3f 100644 --- a/ext/openssl/lib/openssl/ssl.rb +++ b/ext/openssl/lib/openssl/ssl.rb @@ -111,7 +111,7 @@ module OpenSSL # You can get a list of valid methods with OpenSSL::SSL::SSLContext::METHODS def initialize(version = nil) INIT_VARS.each { |v| instance_variable_set v, nil } - self.options = OpenSSL::SSL::OP_ALL + self.options = self.options | OpenSSL::SSL::OP_ALL return unless version self.ssl_version = version end diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb index 55dc518aa6..07e081b352 100644 --- a/test/openssl/test_ssl.rb +++ b/test/openssl/test_ssl.rb @@ -20,9 +20,9 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase } end - def test_options_defaults_to_OP_ALL + def test_options_defaults_to_OP_ALL_on ctx = OpenSSL::SSL::SSLContext.new - assert_equal OpenSSL::SSL::OP_ALL, ctx.options + assert_equal(OpenSSL::SSL::OP_ALL, (OpenSSL::SSL::OP_ALL & ctx.options)) end def test_setting_twice |