File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -556,6 +556,27 @@ def test_sslctx_set_params
556556 ctx . options & OpenSSL ::SSL ::OP_NO_COMPRESSION
557557 end
558558
559+ def test_sslctx_set_params_min_version_on_greater_than_equal_openssl_11
560+ omit 'Omit in OpenSSL 1.0 or earlier versions' unless openssl? ( 1 , 1 , 0 )
561+ omit 'Omit in LibreSSL' if libressl?
562+
563+ ctx = OpenSSL ::SSL ::SSLContext . new
564+ ctx . set_params
565+
566+ # The cached value should not exist.
567+ assert_raise ( NoMethodError ) { ctx . send ( :@min_proto_version ) }
568+ end
569+
570+ def test_sslctx_set_params_min_version_on_less_than_openssl_11
571+ omit 'Omit in OpenSSL 1.1 or later versions' if openssl? ( 1 , 1 , 0 )
572+
573+ ctx = OpenSSL ::SSL ::SSLContext . new
574+ ctx . set_params
575+
576+ # This is not publicly exposed, but read the cached version.
577+ assert_equal OpenSSL ::SSL ::TLS1_VERSION , ctx . send ( :@min_proto_version )
578+ end
579+
559580 def test_post_connect_check_with_anon_ciphers
560581 ctx_proc = -> ctx {
561582 ctx . ssl_version = :TLSv1_2
You can’t perform that action at this time.
0 commit comments