summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 16:25:19 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-21 16:25:19 +0000
commit8cbf2dae5aadfa5d6241b0df2bf44d55db46704f (patch)
treeea3fa9dd3726cd7dd21b14a5980f1c21886c0bfb /test/openssl
parent6cba29b4220cc0277f209af9d172f4ec1ddb5f0e (diff)
fix OpenSSL::SSL::SSLContext#min_version doesn't work
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_ssl.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/openssl/test_ssl.rb b/test/openssl/test_ssl.rb
index ab6382d78f..f1c21d3940 100644
--- a/test/openssl/test_ssl.rb
+++ b/test/openssl/test_ssl.rb
@@ -811,6 +811,33 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
supported
end
+ def test_min_version
+ supported = check_supported_protocol_versions
+
+ ctx = OpenSSL::SSL::SSLContext.new
+ ctx.set_params
+ orig_options = ctx.options
+
+ ctx.set_params(min_version: 999)
+ assert_not_equal(ctx.options, orig_options)
+
+ ctx.min_version = :TLSv1_2
+ assert_not_equal(0, ctx.options & OpenSSL::SSL::OP_NO_TLSv1)
+ assert_not_equal(0, ctx.options & OpenSSL::SSL::OP_NO_TLSv1_1)
+ end
+
+ def test_max_version
+ supported = check_supported_protocol_versions
+
+ ctx = OpenSSL::SSL::SSLContext.new
+ ctx.set_params
+ orig_options = ctx.options
+
+ ctx.max_version = :TLSv1
+ assert_not_equal(0, ctx.options & OpenSSL::SSL::OP_NO_TLSv1_1)
+ assert_not_equal(0, ctx.options & OpenSSL::SSL::OP_NO_TLSv1_2)
+ end
+
def test_minmax_version
supported = check_supported_protocol_versions