aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-11-08 19:32:29 +0200
committerLoïc Hoguin <[email protected]>2016-11-08 19:32:29 +0200
commit237f9e7053dc2d326810c6c758a9ee8c513853b8 (patch)
tree5ed2b1da7a470dc76dad425c1f3100fb40304074 /test
parent9a8e5b57336134d1af11ed19403b18bd37ae7fa9 (diff)
downloadranch-237f9e7053dc2d326810c6c758a9ee8c513853b8.tar.gz
ranch-237f9e7053dc2d326810c6c758a9ee8c513853b8.tar.bz2
ranch-237f9e7053dc2d326810c6c758a9ee8c513853b8.zip
Check for the SSL version for SNI instead of Makefile
Diffstat (limited to 'test')
-rw-r--r--test/acceptor_SUITE.erl22
1 files changed, 15 insertions, 7 deletions
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.