aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gun_tls_proxy.erl8
-rw-r--r--test/gun_test.erl8
-rw-r--r--test/rfc7231_SUITE.erl8
-rw-r--r--test/socks_SUITE.erl4
4 files changed, 8 insertions, 20 deletions
diff --git a/src/gun_tls_proxy.erl b/src/gun_tls_proxy.erl
index 53874f8..38143dd 100644
--- a/src/gun_tls_proxy.erl
+++ b/src/gun_tls_proxy.erl
@@ -41,10 +41,6 @@
-module(gun_tls_proxy).
-behaviour(gen_statem).
--ifdef(OTP_RELEASE).
--compile({nowarn_deprecated_function, [{ssl, ssl_accept, 2}]}).
--endif.
-
%% Gun-specific interface.
-export([start_link/7]).
@@ -460,8 +456,8 @@ do_proxy_init(Parent, Host, Port) ->
{ok, ListenSocket} = ssl:listen(0, [binary, {active, false}|Opts]),
{ok, {_, ListenPort}} = ssl:sockname(ListenSocket),
Parent ! {self(), ListenPort},
- {ok, ClientSocket} = ssl:transport_accept(ListenSocket, 10000),
- ok = ssl:ssl_accept(ClientSocket, 10000),
+ {ok, ClientSocket0} = ssl:transport_accept(ListenSocket, 10000),
+ {ok, ClientSocket} = ssl:handshake(ClientSocket0, 10000),
{ok, OriginSocket} = gen_tcp:connect(
Host, Port,
[binary, {active, false}]),
diff --git a/test/gun_test.erl b/test/gun_test.erl
index 95b1321..ad352c3 100644
--- a/test/gun_test.erl
+++ b/test/gun_test.erl
@@ -16,10 +16,6 @@
-compile(export_all).
-compile(nowarn_export_all).
--ifdef(OTP_RELEASE).
--compile({nowarn_deprecated_function, [{ssl, ssl_accept, 2}]}).
--endif.
-
%% Cowboy listeners.
init_cowboy_tcp(Ref, ProtoOpts, Config) ->
@@ -69,8 +65,8 @@ init_origin(Parent, tls, Protocol, Fun) ->
{ok, ListenSocket} = ssl:listen(0, [binary, {active, false}|Opts]),
{ok, {_, Port}} = ssl:sockname(ListenSocket),
Parent ! {self(), Port},
- {ok, ClientSocket} = ssl:transport_accept(ListenSocket, 5000),
- ok = ssl:ssl_accept(ClientSocket, 5000),
+ {ok, ClientSocket0} = ssl:transport_accept(ListenSocket, 5000),
+ {ok, ClientSocket} = ssl:handshake(ClientSocket0, 5000),
case Protocol of
http2 ->
{ok, <<"h2">>} = ssl:negotiated_protocol(ClientSocket),
diff --git a/test/rfc7231_SUITE.erl b/test/rfc7231_SUITE.erl
index 05af83a..c3f64e9 100644
--- a/test/rfc7231_SUITE.erl
+++ b/test/rfc7231_SUITE.erl
@@ -16,10 +16,6 @@
-compile(export_all).
-compile(nowarn_export_all).
--ifdef(OTP_RELEASE).
--compile({nowarn_deprecated_function, [{ssl, ssl_accept, 2}]}).
--endif.
-
-import(ct_helper, [doc/1]).
-import(gun_test, [init_origin/1]).
-import(gun_test, [init_origin/2]).
@@ -65,8 +61,8 @@ do_proxy_init(Parent, Transport, Status, ConnectRespHeaders, Delay) ->
gen_tcp:accept(ListenSocket, infinity);
gun_tls ->
{ok, ClientSocket0} = ssl:transport_accept(ListenSocket, infinity),
- ssl:ssl_accept(ClientSocket0, infinity),
- {ok, ClientSocket0}
+ {ok, ClientSocket1} = ssl:handshake(ClientSocket0, infinity),
+ {ok, ClientSocket1}
end,
{ok, Data} = case Transport of
gun_tcp ->
diff --git a/test/socks_SUITE.erl b/test/socks_SUITE.erl
index 19dfcbe..f4c56c0 100644
--- a/test/socks_SUITE.erl
+++ b/test/socks_SUITE.erl
@@ -59,8 +59,8 @@ do_proxy_init(Parent, Transport, Auth) ->
gen_tcp:accept(ListenSocket, 5000);
gun_tls ->
{ok, ClientSocket0} = ssl:transport_accept(ListenSocket, 5000),
- ssl:ssl_accept(ClientSocket0, 5000),
- {ok, ClientSocket0}
+ {ok, ClientSocket1} = ssl:handshake(ClientSocket0, 5000),
+ {ok, ClientSocket1}
end,
Recv = case Transport of
gun_tcp -> fun gen_tcp:recv/3;