diff options
-rw-r--r-- | Makefile | 11 | ||||
-rw-r--r-- | test/acceptor_SUITE.erl | 22 |
2 files changed, 17 insertions, 16 deletions
@@ -8,19 +8,12 @@ COMPILE_FIRST = ranch_transport CT_OPTS += -pa test -ct_hooks ranch_ct_hook [] PLT_APPS = crypto public_key ssl -CI_OTP_NO_SNI = \ +CI_OTP ?= \ OTP_R16B OTP_R16B01 OTP_R16B02 OTP_R16B03-1 \ - OTP-17.1.2 OTP-17.2.2 OTP-17.3.4 OTP-17.4.1 OTP-17.5.6.6 -CI_OTP ?= $(CI_OTP_NO_SNI) \ + OTP-17.1.2 OTP-17.2.2 OTP-17.3.4 OTP-17.4.1 OTP-17.5.6.6 \ OTP-18.0.3 OTP-18.1.5 OTP-18.2.4.1 OTP-18.3.4.4 \ OTP-19.0.7 OTP-19.1.5 -ifdef CI_OTP_RELEASE -ifneq ($(filter $(CI_OTP_RELEASE),$(CI_OTP_NO_SNI)),) -TEST_ERLC_OPTS += -DTEST_NO_SNI=1 -endif -endif - # Dependencies. TEST_DEPS = ct_helper diff --git a/test/acceptor_SUITE.erl b/test/acceptor_SUITE.erl index 33ccd41..547d1c0 100644 --- a/test/acceptor_SUITE.erl +++ b/test/acceptor_SUITE.erl @@ -134,14 +134,15 @@ ssl_echo(_) -> {'EXIT', _} = begin catch ranch:get_port(Name) end, ok. --ifdef(TEST_NO_SNI). ssl_sni_echo(_) -> - {skip, "No SNI support."}. + case application:get_key(ssl, vsn) of + {ok, Vsn} when Vsn >= "7.0" -> + do_ssl_sni_echo(); + _ -> + {skip, "No SNI support."} + end. -ssl_sni_fail(_) -> - {skip, "No SNI support."}. --else. -ssl_sni_echo(_) -> +do_ssl_sni_echo() -> doc("Ensure that SNI works with SSL transport."), Name = name(), Opts = ct_helper:get_certs_from_ets(), @@ -157,6 +158,14 @@ ssl_sni_echo(_) -> ok. ssl_sni_fail(_) -> + case application:get_key(ssl, vsn) of + {ok, Vsn} when Vsn >= "7.0" -> + do_ssl_sni_fail(); + _ -> + {skip, "No SNI support."} + end. + +do_ssl_sni_fail() -> doc("Ensure that connection fails when host is not in SNI list."), Name = name(), Opts = ct_helper:get_certs_from_ets(), @@ -167,7 +176,6 @@ ssl_sni_fail(_) -> %% Make sure the listener stopped. {'EXIT', _} = begin catch ranch:get_port(Name) end, ok. --endif. %% tcp. |