From a4425a1d7db2d9e35f246aa078c324988ea395f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 11 Oct 2022 18:31:12 +0200 Subject: Update tests for OTP-25+ --- test/event_SUITE.erl | 26 +++++++++++++------------- test/gun_SUITE.erl | 4 ++-- test/raw_SUITE.erl | 14 +++++++------- test/rfc6265bis_SUITE.erl | 26 +++++++++++++------------- test/rfc7230_SUITE.erl | 2 +- test/rfc7231_SUITE.erl | 14 +++++++------- test/rfc7540_SUITE.erl | 16 ++++++++-------- test/socks_SUITE.erl | 16 ++++++++-------- test/sse_SUITE.erl | 10 +++++----- test/tunnel_SUITE.erl | 10 +++++----- 10 files changed, 69 insertions(+), 69 deletions(-) (limited to 'test') diff --git a/test/event_SUITE.erl b/test/event_SUITE.erl index abd217d..ac8f1fc 100644 --- a/test/event_SUITE.erl +++ b/test/event_SUITE.erl @@ -214,7 +214,7 @@ tls_handshake_end_error(Config) -> event_handler => {?MODULE, self()}, protocols => [config(name, config(tc_group_properties, Config))], transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }, {ok, Pid} = gun:open("localhost", OriginPort, Opts), #{ @@ -256,7 +256,7 @@ tls_handshake_start_tcp_connect_tls(Config) -> host => "localhost", port => OriginPort, transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), ReplyTo = self(), #{ @@ -290,7 +290,7 @@ tls_handshake_end_error_tcp_connect_tls(Config) -> host => "localhost", port => OriginPort, transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), ReplyTo = self(), #{ @@ -324,7 +324,7 @@ tls_handshake_end_ok_tcp_connect_tls(Config) -> host => "localhost", port => OriginPort, transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), ReplyTo = self(), #{ @@ -351,7 +351,7 @@ tls_handshake_start_tls_connect_tls(Config) -> event_handler => {?MODULE, self()}, protocols => [Protocol], transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, Protocol} = gun:await_up(ConnPid), tunnel_SUITE:do_handshake_completed(Protocol, ProxyPid), @@ -361,7 +361,7 @@ tls_handshake_start_tls_connect_tls(Config) -> host => "localhost", port => OriginPort, transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), ReplyTo = self(), #{ @@ -388,7 +388,7 @@ tls_handshake_end_error_tls_connect_tls(Config) -> event_handler => {?MODULE, self()}, protocols => [Protocol], transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, Protocol} = gun:await_up(ConnPid), tunnel_SUITE:do_handshake_completed(Protocol, ProxyPid), @@ -398,7 +398,7 @@ tls_handshake_end_error_tls_connect_tls(Config) -> host => "localhost", port => OriginPort, transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), ReplyTo = self(), #{ @@ -425,7 +425,7 @@ tls_handshake_end_ok_tls_connect_tls(Config) -> event_handler => {?MODULE, self()}, protocols => [Protocol], transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, Protocol} = gun:await_up(ConnPid), tunnel_SUITE:do_handshake_completed(Protocol, ProxyPid), @@ -435,7 +435,7 @@ tls_handshake_end_ok_tls_connect_tls(Config) -> host => "localhost", port => OriginPort, transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), ReplyTo = self(), #{ @@ -1793,7 +1793,7 @@ do_protocol_changed_tls_connect(Config, OriginProtocol) -> event_handler => {?MODULE, self()}, protocols => [ProxyProtocol], transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, ProxyProtocol} = gun:await_up(ConnPid), tunnel_SUITE:do_handshake_completed(ProxyProtocol, ProxyPid), @@ -1801,7 +1801,7 @@ do_protocol_changed_tls_connect(Config, OriginProtocol) -> host => "localhost", port => OriginPort, transport => tls, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [OriginProtocol] }), #{ @@ -2031,7 +2031,7 @@ do_gun_open_tls(Config) -> http2_opts => #{notify_settings_changed => true}, protocols => [config(name, config(tc_group_properties, Config))], transport => tls, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }, {ok, Pid} = gun:open("localhost", OriginPort, Opts), {ok, Pid, OriginPort}. diff --git a/test/gun_SUITE.erl b/test/gun_SUITE.erl index 9112c5d..6501355 100644 --- a/test/gun_SUITE.erl +++ b/test/gun_SUITE.erl @@ -461,14 +461,14 @@ server_name_indication_custom(_) -> doc("Ensure a custom server_name_indication is accepted."), do_server_name_indication("localhost", net_adm:localhost(), #{ tls_opts => [ - {verify, verify_none}, + {verify, verify_none}, {versions, ['tlsv1.2']}, {server_name_indication, net_adm:localhost()}] }). server_name_indication_default(_) -> doc("Ensure a default server_name_indication is accepted."), do_server_name_indication(net_adm:localhost(), net_adm:localhost(), #{ - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }). do_server_name_indication(Host, Expected, GunOpts) -> diff --git a/test/raw_SUITE.erl b/test/raw_SUITE.erl index ac64efb..67fa542 100644 --- a/test/raw_SUITE.erl +++ b/test/raw_SUITE.erl @@ -40,7 +40,7 @@ do_direct_raw(OriginTransport) -> {ok, OriginPid, OriginPort} = init_origin(OriginTransport, raw, fun do_echo/3), {ok, ConnPid} = gun:open("localhost", OriginPort, #{ transport => OriginTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [raw] }), {ok, raw} = gun:await_up(ConnPid), @@ -79,12 +79,12 @@ do_socks5_raw(OriginTransport, ProxyTransport) -> {ok, ProxyPid, ProxyPort} = socks_SUITE:do_proxy_start(ProxyTransport, none), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [{socks, #{ host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [raw] }}] }), @@ -135,14 +135,14 @@ do_connect_raw(OriginTransport, ProxyTransport) -> Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, http} = gun:await_up(ConnPid), StreamRef = gun:connect(ConnPid, #{ host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [raw] }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid), @@ -216,7 +216,7 @@ do_http11_upgrade_raw(OriginTransport) -> end), {ok, ConnPid} = gun:open("localhost", OriginPort, #{ transport => OriginTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, http} = gun:await_up(ConnPid), handshake_completed = receive_from(OriginPid), @@ -288,7 +288,7 @@ do_http2_connect_raw(OriginTransport, ProxyScheme, ProxyTransport) -> Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http2] }), {ok, http2} = gun:await_up(ConnPid), diff --git a/test/rfc6265bis_SUITE.erl b/test/rfc6265bis_SUITE.erl index f9f93b4..5c66c53 100644 --- a/test/rfc6265bis_SUITE.erl +++ b/test/rfc6265bis_SUITE.erl @@ -94,7 +94,7 @@ do_informational_set_cookie(Config, Boolean) -> Protocol = config(protocol, Config), {ok, ConnPid} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [{Protocol, #{cookie_ignore_informational => Boolean}}], cookie_store => gun_cookies_list:init() }), @@ -128,7 +128,7 @@ set_cookie_connect_tcp(Config) -> host => "localhost", port => config(port, Config), transport => Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol] }), {response, fin, 200, _} = gun:await(ConnPid, StreamRef1), @@ -152,7 +152,7 @@ set_cookie_connect_tls(Config) -> {ok, ProxyPid, ProxyPort} = event_SUITE:do_proxy_start(Protocol, tls), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => tls, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), @@ -162,7 +162,7 @@ set_cookie_connect_tls(Config) -> host => "localhost", port => config(port, Config), transport => Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol] }), {response, fin, 200, _} = gun:await(ConnPid, StreamRef1), @@ -449,7 +449,7 @@ do_wpt_domain_test(Config, TestCase) -> Protocol = config(protocol, Config), {ok, ConnPid} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), @@ -520,7 +520,7 @@ wpt_path_default(Config) -> Protocol = config(protocol, Config), {ok, ConnPid} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), @@ -567,7 +567,7 @@ wpt_path_match(Config) -> ct:log("Positive test: ~s", [P]), {ok, ConnPid} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), @@ -587,7 +587,7 @@ wpt_path_match(Config) -> ct:log("Negative test: ~s", [P]), {ok, ConnPid} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), @@ -680,7 +680,7 @@ do_wpt_prefix_common(Config, TestCase, Expected, Name) -> ct:log("Test case: ~s~nCookie must be set? ~s", [TestCase, Expected]), {ok, ConnPid} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), @@ -733,7 +733,7 @@ do_wpt_secure_common(Config, TestCase) -> Protocol = config(protocol, Config), {ok, ConnPid} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), @@ -770,7 +770,7 @@ do_wpt_secure_ws_common(Config) -> Protocol = config(protocol, Config), {ok, ConnPid1} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), @@ -783,7 +783,7 @@ do_wpt_secure_ws_common(Config) -> gun:close(ConnPid1), {ok, ConnPid2} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => CookieStore }), @@ -912,7 +912,7 @@ do_wpt_set_test(TestPath, Name, Cookie, Expected, DefaultPath, Config) -> Protocol = config(protocol, Config), {ok, ConnPid} = gun:open("localhost", config(port, Config), #{ transport => config(transport, Config), - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol], cookie_store => gun_cookies_list:init() }), diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl index b0ad323..b7c29e4 100644 --- a/test/rfc7230_SUITE.erl +++ b/test/rfc7230_SUITE.erl @@ -59,7 +59,7 @@ do_host_port(Transport, DefaultPort, HostHeaderPort) -> {ok, OriginPid, OriginPort} = init_origin(Transport, http), {ok, ConnPid} = gun:open("localhost", OriginPort, #{ transport => Transport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, http} = gun:await_up(ConnPid), %% Change the origin's port in the state to trigger the default port behavior. diff --git a/test/rfc7231_SUITE.erl b/test/rfc7231_SUITE.erl index e07ec04..c274ecb 100644 --- a/test/rfc7231_SUITE.erl +++ b/test/rfc7231_SUITE.erl @@ -148,14 +148,14 @@ do_connect_http(OriginScheme, OriginTransport, ProxyTransport) -> Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, http} = gun:await_up(ConnPid), StreamRef = gun:connect(ConnPid, #{ host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid), {response, fin, 200, _} = gun:await(ConnPid, StreamRef), @@ -207,14 +207,14 @@ do_connect_h2(OriginScheme, OriginTransport, ProxyTransport) -> Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, http} = gun:await_up(ConnPid), StreamRef = gun:connect(ConnPid, #{ host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http2] }), {request, <<"CONNECT">>, Authority, 'HTTP/1.1', _} = receive_from(ProxyPid), @@ -256,7 +256,7 @@ do_connect_through_multiple_proxies(OriginScheme, OriginTransport, ProxiesTransp {ok, Proxy2Pid, Proxy2Port} = do_proxy_start(ProxiesTransport), {ok, ConnPid} = gun:open("localhost", Proxy1Port, #{ transport => ProxiesTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {ok, http} = gun:await_up(ConnPid), Authority1 = iolist_to_binary(["localhost:", integer_to_binary(Proxy2Port)]), @@ -264,7 +264,7 @@ do_connect_through_multiple_proxies(OriginScheme, OriginTransport, ProxiesTransp host => "localhost", port => Proxy2Port, transport => ProxiesTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), {request, <<"CONNECT">>, Authority1, 'HTTP/1.1', _} = receive_from(Proxy1Pid), {response, fin, 200, _} = gun:await(ConnPid, StreamRef1), @@ -274,7 +274,7 @@ do_connect_through_multiple_proxies(OriginScheme, OriginTransport, ProxiesTransp host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }, [], #{tunnel => StreamRef1}), {request, <<"CONNECT">>, Authority2, 'HTTP/1.1', _} = receive_from(Proxy2Pid), {response, fin, 200, _} = gun:await(ConnPid, StreamRef2), diff --git a/test/rfc7540_SUITE.erl b/test/rfc7540_SUITE.erl index 2423f24..159d036 100644 --- a/test/rfc7540_SUITE.erl +++ b/test/rfc7540_SUITE.erl @@ -214,7 +214,7 @@ do_authority_port(Transport0, DefaultPort, AuthorityHeaderPort) -> end), {ok, ConnPid} = gun:open("localhost", OriginPort, #{ transport => Transport0, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http2] }), {ok, http2} = gun:await_up(ConnPid), @@ -508,7 +508,7 @@ do_connect_http(OriginScheme, OriginTransport, OriginProtocol, ProxyScheme, Prox Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http2] }), {ok, http2} = gun:await_up(ConnPid), @@ -517,7 +517,7 @@ do_connect_http(OriginScheme, OriginTransport, OriginProtocol, ProxyScheme, Prox host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [OriginProtocol] }), {request, #{ @@ -613,7 +613,7 @@ do_connect_cowboy(_OriginScheme, OriginTransport, OriginProtocol, _ProxyScheme, Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http2] }), {ok, http2} = gun:await_up(ConnPid), @@ -622,7 +622,7 @@ do_connect_cowboy(_OriginScheme, OriginTransport, OriginProtocol, _ProxyScheme, host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [OriginProtocol] }), {request, #{ @@ -710,7 +710,7 @@ do_connect_via_multiple_proxies(OriginTransport, OriginProtocol, %% First proxy. {ok, ConnPid} = gun:open("localhost", Proxy1Port, #{ transport => Proxy1Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http2] }), {ok, http2} = gun:await_up(ConnPid), @@ -720,7 +720,7 @@ do_connect_via_multiple_proxies(OriginTransport, OriginProtocol, host => "localhost", port => Proxy2Port, transport => Proxy2Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Proxy2Protocol] }, []), Authority1 = iolist_to_binary(["localhost:", integer_to_binary(Proxy2Port)]), @@ -735,7 +735,7 @@ do_connect_via_multiple_proxies(OriginTransport, OriginProtocol, host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [OriginProtocol] }, [], #{tunnel => StreamRef1}), Authority2 = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), diff --git a/test/socks_SUITE.erl b/test/socks_SUITE.erl index b536b36..9ec0ef1 100644 --- a/test/socks_SUITE.erl +++ b/test/socks_SUITE.erl @@ -214,13 +214,13 @@ do_socks5(OriginScheme, OriginTransport, OriginProtocol, ProxyTransport, SocksAu Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), {ok, ConnPid} = gun:open("localhost", ProxyPort, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [{socks, #{ auth => [SocksAuth], host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [OriginProtocol] }}] }), @@ -291,17 +291,17 @@ do_socks5_through_multiple_proxies(OriginScheme, OriginTransport, ProxyTransport Authority = iolist_to_binary(["localhost:", integer_to_binary(OriginPort)]), {ok, ConnPid} = gun:open("localhost", Proxy1Port, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [{socks, #{ host => "localhost", port => Proxy2Port, transport => ProxyTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [{socks, #{ host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }}] }}] }), @@ -371,7 +371,7 @@ do_socks5_through_connect_proxy(OriginScheme, OriginTransport, ProxyTransport) - {ok, Proxy2Pid, Proxy2Port} = do_proxy_start(ProxyTransport, none), {ok, ConnPid} = gun:open("localhost", Proxy1Port, #{ transport => ProxyTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }), %% We receive a gun_up first. This is the HTTP proxy. {ok, http} = gun:await_up(ConnPid), @@ -380,12 +380,12 @@ do_socks5_through_connect_proxy(OriginScheme, OriginTransport, ProxyTransport) - host => "localhost", port => Proxy2Port, transport => ProxyTransport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [{socks, #{ host => "localhost", port => OriginPort, transport => OriginTransport, - tls_opts => [{verify, verify_none}] + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}] }}] }), {request, <<"CONNECT">>, Authority1, 'HTTP/1.1', _} = receive_from(Proxy1Pid), diff --git a/test/sse_SUITE.erl b/test/sse_SUITE.erl index 93b1acb..7d8d28f 100644 --- a/test/sse_SUITE.erl +++ b/test/sse_SUITE.erl @@ -41,7 +41,7 @@ init_routes() -> [ http_clock(Config) -> {ok, Pid} = gun:open("localhost", config(port, Config), #{ transport => tls, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http], http_opts => #{content_handlers => [gun_sse_h, gun_data_h]} }), @@ -51,7 +51,7 @@ http_clock(Config) -> http2_clock(Config) -> {ok, Pid} = gun:open("localhost", config(port, Config), #{ transport => tls, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http2], http2_opts => #{content_handlers => [gun_sse_h, gun_data_h]} }), @@ -61,7 +61,7 @@ http2_clock(Config) -> http_clock_close(Config) -> {ok, Pid} = gun:open("localhost", config(port, Config), #{ transport => tls, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http], http_opts => #{ content_handlers => [gun_sse_h, gun_data_h], @@ -107,7 +107,7 @@ event_loop(Pid, Ref, N) -> lone_id(Config) -> {ok, Pid} = gun:open("localhost", config(port, Config), #{ transport => tls, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http], http_opts => #{content_handlers => [gun_sse_h, gun_data_h]} }), @@ -135,7 +135,7 @@ lone_id(Config) -> with_mime_param(Config) -> {ok, Pid} = gun:open("localhost", config(port, Config), #{ transport => tls, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [http], http_opts => #{content_handlers => [gun_sse_h, gun_data_h]} }), diff --git a/test/tunnel_SUITE.erl b/test/tunnel_SUITE.erl index 9027af2..084dfd8 100644 --- a/test/tunnel_SUITE.erl +++ b/test/tunnel_SUITE.erl @@ -831,7 +831,7 @@ do_proxy1(State=#st{proxy1=Type, proxy1_pid=Proxy1Pid, proxy1_port=Port}) -> {Transport, Protocol} = do_type(Type), {ok, ConnPid} = gun:open("localhost", Port, #{ transport => Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [case Protocol of socks -> {Protocol, do_proxy2_socks_opts(State)}; @@ -849,7 +849,7 @@ do_proxy2_socks_opts(State=#st{proxy2=Type, proxy2_port=Port}) -> host => "localhost", port => Port, transport => Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [case Protocol of socks -> {Protocol, do_origin_socks_opts(State)}; @@ -864,7 +864,7 @@ do_origin_socks_opts(#st{origin=Type, origin_port=Port}) -> host => "localhost", port => Port, transport => Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol] }. @@ -882,7 +882,7 @@ do_proxy2(State=#st{proxy2=Type, proxy2_pid=Proxy2Pid, proxy2_port=Port}, ConnPi host => "localhost", port => Port, transport => Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [case Protocol of socks -> {Protocol, do_origin_socks_opts(State)}; @@ -909,7 +909,7 @@ do_origin(#st{origin=Type, origin_port=Port}, ConnPid, StreamRef1) -> host => "localhost", port => Port, transport => Transport, - tls_opts => [{verify, verify_none}], + tls_opts => [{verify, verify_none}, {versions, ['tlsv1.2']}], protocols => [Protocol] }, [], #{tunnel => StreamRef1}), {response, fin, 200, _} = gun:await(ConnPid, StreamRef2), -- cgit v1.2.3