diff options
author | Loïc Hoguin <[email protected]> | 2019-04-22 21:56:53 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-04-22 21:56:53 +0200 |
commit | beac669a066f3d8936c392976531a0070ce93c63 (patch) | |
tree | eb3dfc43d7f9e5fa0c97a34f5e541245e7e51473 /src/gun_tls_proxy.erl | |
parent | 9cf35986eb3c63d55c85bceb13718b3aca20867c (diff) | |
download | gun-beac669a066f3d8936c392976531a0070ce93c63.tar.gz gun-beac669a066f3d8936c392976531a0070ce93c63.tar.bz2 gun-beac669a066f3d8936c392976531a0070ce93c63.zip |
Use ssl:ssl_accept/2 in tests to support OTP 20+
ssl:handshake/2 was introduced in OTP 21.
Diffstat (limited to 'src/gun_tls_proxy.erl')
-rw-r--r-- | src/gun_tls_proxy.erl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gun_tls_proxy.erl b/src/gun_tls_proxy.erl index 123a156..d66e91c 100644 --- a/src/gun_tls_proxy.erl +++ b/src/gun_tls_proxy.erl @@ -41,6 +41,10 @@ -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/6]). @@ -416,7 +420,7 @@ do_proxy_init(Parent, Host, Port) -> {ok, {_, ListenPort}} = ssl:sockname(ListenSocket), Parent ! {self(), ListenPort}, {ok, ClientSocket} = ssl:transport_accept(ListenSocket, 10000), - {ok, _} = ssl:handshake(ClientSocket, 10000), + ok = ssl:ssl_accept(ClientSocket, 10000), {ok, OriginSocket} = gen_tcp:connect( Host, Port, [binary, {active, false}]), |