diff options
author | Loïc Hoguin <[email protected]> | 2024-03-14 15:41:30 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2024-03-14 15:41:30 +0100 |
commit | 8b5f1609faffcf1166ca54c08df4ca9216c51993 (patch) | |
tree | 8360c67d59714c1641764debc2c074e4eaa90604 /test/gun_test.erl | |
parent | 5e177270a2be530bbec55381d0fe66a252c3a998 (diff) | |
download | gun-8b5f1609faffcf1166ca54c08df4ca9216c51993.tar.gz gun-8b5f1609faffcf1166ca54c08df4ca9216c51993.tar.bz2 gun-8b5f1609faffcf1166ca54c08df4ca9216c51993.zip |
Use public_key:cacerts_get/0 when possible
Also "fix" many TLS test failures due to yet more changes
in the default options for TLS.
Also small changes to make Dialyzer happy.
Diffstat (limited to 'test/gun_test.erl')
-rw-r--r-- | test/gun_test.erl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/gun_test.erl b/test/gun_test.erl index 18fcfbf..cffeed5 100644 --- a/test/gun_test.erl +++ b/test/gun_test.erl @@ -24,7 +24,9 @@ init_cowboy_tcp(Ref, ProtoOpts, Config) -> init_cowboy_tls(Ref, ProtoOpts, Config) -> Opts = ct_helper:get_certs_from_ets(), - {ok, _} = cowboy:start_tls(Ref, Opts ++ [{port, 0}], ProtoOpts), + {ok, _} = cowboy:start_tls(Ref, + [{verify, verify_none}, {fail_if_no_peer_cert, false}] + ++ Opts ++ [{port, 0}], ProtoOpts), [{ref, Ref}, {port, ranch:get_port(Ref)}|Config]. %% Origin server helpers. @@ -64,7 +66,8 @@ init_origin(Parent, tls, Protocol, Fun) -> 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, ListenSocket} = ssl:listen(0, [binary, {active, false}, + {fail_if_no_peer_cert, false}|Opts]), {ok, {_, Port}} = ssl:sockname(ListenSocket), Parent ! {self(), Port}, {ok, ClientSocket0} = ssl:transport_accept(ListenSocket, 5000), |