diff options
author | Loïc Hoguin <[email protected]> | 2019-09-16 21:26:51 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-09-22 16:46:35 +0200 |
commit | 28c19230eda29c42b376e35046d39acc1365881a (patch) | |
tree | ae04380ad338eb6f6ffe577529d5f2ff7d888872 /src/gun_tls_proxy.erl | |
parent | 5043b98d5301e41238afd15d271f5c6b68081b04 (diff) | |
download | gun-28c19230eda29c42b376e35046d39acc1365881a.tar.gz gun-28c19230eda29c42b376e35046d39acc1365881a.tar.bz2 gun-28c19230eda29c42b376e35046d39acc1365881a.zip |
Further consolidation of TLS handshakes
Diffstat (limited to 'src/gun_tls_proxy.erl')
-rw-r--r-- | src/gun_tls_proxy.erl | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gun_tls_proxy.erl b/src/gun_tls_proxy.erl index d519919..1bd56cb 100644 --- a/src/gun_tls_proxy.erl +++ b/src/gun_tls_proxy.erl @@ -237,12 +237,7 @@ not_connected(cast, Msg={setopts, _}, State) -> {keep_state_and_data, postpone}; not_connected(cast, Msg={connect_proc, {ok, Socket}}, State=#state{owner_pid=OwnerPid, extra=Extra}) -> ?DEBUG_LOG("msg ~0p state ~0p", [Msg, State]), - %% @todo We should distinguish case when no protocol was negotiated (for socks). - Protocol = case ssl:negotiated_protocol(Socket) of - {ok, <<"h2">>} -> gun_http2; - _ -> gun_http - end, - OwnerPid ! {?MODULE, self(), {ok, Protocol}, Extra}, + OwnerPid ! {?MODULE, self(), {ok, ssl:negotiated_protocol(Socket)}, Extra}, %% We need to spawn this call before OTP-21.2 because it triggers %% a cb_setopts call that blocks us. Might be OK to just leave it %% like this once we support 21.2+ only. |