aboutsummaryrefslogtreecommitdiffstats
path: root/test/gun_test.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2022-03-08 13:55:51 +0100
committerLoïc Hoguin <[email protected]>2022-03-08 13:55:51 +0100
commit7ed6d220176be60ace521a1a11a309f6537c0489 (patch)
tree7f0cc2a7bf114bcbc677f6569eaab0df1ff3f8cc /test/gun_test.erl
parent4dd6f090e35f9cf067089dfce953647a0999d306 (diff)
downloadgun-7ed6d220176be60ace521a1a11a309f6537c0489.tar.gz
gun-7ed6d220176be60ace521a1a11a309f6537c0489.tar.bz2
gun-7ed6d220176be60ace521a1a11a309f6537c0489.zip
Add tests for SNI
Diffstat (limited to 'test/gun_test.erl')
-rw-r--r--test/gun_test.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/gun_test.erl b/test/gun_test.erl
index ad352c3..79f70c9 100644
--- a/test/gun_test.erl
+++ b/test/gun_test.erl
@@ -58,10 +58,12 @@ init_origin(Parent, Transport, Protocol, Fun)
Fun(Parent, ClientSocket, gen_tcp);
init_origin(Parent, tls, Protocol, Fun) ->
Opts0 = ct_helper:get_certs_from_ets(),
- Opts = case Protocol of
+ Opts1 = case Protocol of
http2 -> [{alpn_preferred_protocols, [<<"h2">>]}|Opts0];
_ -> Opts0
end,
+ %% sni_hosts is necessary for SNI tests to succeed.
+ Opts = [{sni_hosts, [{net_adm:localhost(), []}]}|Opts1],
{ok, ListenSocket} = ssl:listen(0, [binary, {active, false}|Opts]),
{ok, {_, Port}} = ssl:sockname(ListenSocket),
Parent ! {self(), Port},