@@ -125,7 +125,6 @@ def test_add_certificate
125125
126126 def test_add_certificate_multiple_certs
127127 pend "EC is not supported" unless defined? ( OpenSSL ::PKey ::EC )
128- pend "TLS 1.2 is not supported" unless tls12_supported?
129128
130129 ca2_key = Fixtures . pkey ( "rsa-3" )
131130 ca2_exts = [
@@ -554,8 +553,6 @@ def test_sslctx_set_params
554553 end
555554
556555 def test_post_connect_check_with_anon_ciphers
557- pend "TLS 1.2 is not supported" unless tls12_supported?
558-
559556 ctx_proc = -> ctx {
560557 ctx . ssl_version = :TLSv1_2
561558 ctx . ciphers = "aNULL"
@@ -1355,7 +1352,6 @@ def test_alpn_protocol_selection_cancel
13551352 end
13561353
13571354 def test_npn_protocol_selection_ary
1358- pend "TLS 1.2 is not supported" unless tls12_supported?
13591355 pend "NPN is not supported" unless \
13601356 OpenSSL ::SSL ::SSLContext . method_defined? ( :npn_select_cb )
13611357 pend "LibreSSL 2.6 has broken NPN functions" if libressl? ( 2 , 6 , 1 )
@@ -1376,7 +1372,6 @@ def test_npn_protocol_selection_ary
13761372 end
13771373
13781374 def test_npn_protocol_selection_enum
1379- pend "TLS 1.2 is not supported" unless tls12_supported?
13801375 pend "NPN is not supported" unless \
13811376 OpenSSL ::SSL ::SSLContext . method_defined? ( :npn_select_cb )
13821377 pend "LibreSSL 2.6 has broken NPN functions" if libressl? ( 2 , 6 , 1 )
@@ -1401,7 +1396,6 @@ def advertised.each
14011396 end
14021397
14031398 def test_npn_protocol_selection_cancel
1404- pend "TLS 1.2 is not supported" unless tls12_supported?
14051399 pend "NPN is not supported" unless \
14061400 OpenSSL ::SSL ::SSLContext . method_defined? ( :npn_select_cb )
14071401 pend "LibreSSL 2.6 has broken NPN functions" if libressl? ( 2 , 6 , 1 )
@@ -1415,7 +1409,6 @@ def test_npn_protocol_selection_cancel
14151409 end
14161410
14171411 def test_npn_advertised_protocol_too_long
1418- pend "TLS 1.2 is not supported" unless tls12_supported?
14191412 pend "NPN is not supported" unless \
14201413 OpenSSL ::SSL ::SSLContext . method_defined? ( :npn_select_cb )
14211414 pend "LibreSSL 2.6 has broken NPN functions" if libressl? ( 2 , 6 , 1 )
@@ -1429,7 +1422,6 @@ def test_npn_advertised_protocol_too_long
14291422 end
14301423
14311424 def test_npn_selected_protocol_too_long
1432- pend "TLS 1.2 is not supported" unless tls12_supported?
14331425 pend "NPN is not supported" unless \
14341426 OpenSSL ::SSL ::SSLContext . method_defined? ( :npn_select_cb )
14351427 pend "LibreSSL 2.6 has broken NPN functions" if libressl? ( 2 , 6 , 1 )
@@ -1470,40 +1462,36 @@ def test_sync_close_without_connect
14701462 end
14711463
14721464 def test_get_ephemeral_key
1473- if tls12_supported?
1474- # kRSA
1475- ctx_proc1 = proc { |ctx |
1476- ctx . ssl_version = :TLSv1_2
1477- ctx . ciphers = "kRSA"
1478- }
1479- start_server ( ctx_proc : ctx_proc1 , ignore_listener_error : true ) do |port |
1480- ctx = OpenSSL ::SSL ::SSLContext . new
1481- ctx . ssl_version = :TLSv1_2
1482- ctx . ciphers = "kRSA"
1483- begin
1484- server_connect ( port , ctx ) { |ssl | assert_nil ssl . tmp_key }
1485- rescue OpenSSL ::SSL ::SSLError
1486- # kRSA seems disabled
1487- raise unless $!. message =~ /no cipher/
1488- end
1465+ # kRSA
1466+ ctx_proc1 = proc { |ctx |
1467+ ctx . ssl_version = :TLSv1_2
1468+ ctx . ciphers = "kRSA"
1469+ }
1470+ start_server ( ctx_proc : ctx_proc1 , ignore_listener_error : true ) do |port |
1471+ ctx = OpenSSL ::SSL ::SSLContext . new
1472+ ctx . ssl_version = :TLSv1_2
1473+ ctx . ciphers = "kRSA"
1474+ begin
1475+ server_connect ( port , ctx ) { |ssl | assert_nil ssl . tmp_key }
1476+ rescue OpenSSL ::SSL ::SSLError
1477+ # kRSA seems disabled
1478+ raise unless $!. message =~ /no cipher/
14891479 end
14901480 end
14911481
1492- if defined? ( OpenSSL ::PKey ::DH ) && tls12_supported?
1493- # DHE
1494- # TODO: How to test this with TLS 1.3?
1495- ctx_proc2 = proc { |ctx |
1496- ctx . ssl_version = :TLSv1_2
1497- ctx . ciphers = "EDH"
1482+ # DHE
1483+ # TODO: How to test this with TLS 1.3?
1484+ ctx_proc2 = proc { |ctx |
1485+ ctx . ssl_version = :TLSv1_2
1486+ ctx . ciphers = "EDH"
1487+ }
1488+ start_server ( ctx_proc : ctx_proc2 ) do |port |
1489+ ctx = OpenSSL ::SSL ::SSLContext . new
1490+ ctx . ssl_version = :TLSv1_2
1491+ ctx . ciphers = "EDH"
1492+ server_connect ( port , ctx ) { |ssl |
1493+ assert_instance_of OpenSSL ::PKey ::DH , ssl . tmp_key
14981494 }
1499- start_server ( ctx_proc : ctx_proc2 ) do |port |
1500- ctx = OpenSSL ::SSL ::SSLContext . new
1501- ctx . ssl_version = :TLSv1_2
1502- ctx . ciphers = "EDH"
1503- server_connect ( port , ctx ) { |ssl |
1504- assert_instance_of OpenSSL ::PKey ::DH , ssl . tmp_key
1505- }
1506- end
15071495 end
15081496
15091497 if defined? ( OpenSSL ::PKey ::EC )
@@ -1633,8 +1621,6 @@ def test_tmp_dh
16331621 end
16341622
16351623 def test_ecdh_curves_tls12
1636- pend "EC is disabled" unless defined? ( OpenSSL ::PKey ::EC )
1637-
16381624 ctx_proc = -> ctx {
16391625 # Enable both ECDHE (~ TLS 1.2) cipher suites and TLS 1.3
16401626 ctx . max_version = OpenSSL ::SSL ::TLS1_2_VERSION
0 commit comments