0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Fix TLS tests for OTP-26+

ct_helper now uses the test certificates generated by
public_key. A few adjustments had to be made as a result.
This commit is contained in:
Loïc Hoguin 2023-03-30 15:38:29 +02:00
parent 251e70b219
commit 12108ab668
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
5 changed files with 70 additions and 60 deletions

View file

@ -112,10 +112,14 @@ gun_open(Config) ->
gun_open(Config, #{}).
gun_open(Config, Opts) ->
TlsOpts = case proplists:get_value(no_cert, Config, false) of
true -> [{verify, verify_none}];
false -> ct_helper:get_certs_from_ets()
end,
{ok, ConnPid} = gun:open("localhost", config(port, Config), Opts#{
retry => 0,
transport => config(type, Config),
tls_opts => [{versions, ['tlsv1.2']}|proplists:get_value(tls_opts, Config, [])],
tls_opts => TlsOpts,
protocols => [config(protocol, Config)]
}),
ConnPid.