aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_http.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gun_http.erl')
-rw-r--r--src/gun_http.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gun_http.erl b/src/gun_http.erl
index 59b127f..576c013 100644
--- a/src/gun_http.erl
+++ b/src/gun_http.erl
@@ -298,12 +298,14 @@ handle_head(Data, State=#http_state{version=ClientVersion, content_handlers=Hand
Protocols = maps:get(protocols, Destination, [http]),
case Destination of
#{transport := tls} ->
- TLSOpts = maps:get(tls_opts, Destination, []),
- TLSTimeout = maps:get(tls_handshake_timeout, Destination, infinity),
- {[
- {origin, <<"https">>, NewHost, NewPort, connect},
- {tls_handshake, RealStreamRef, ReplyTo, TLSOpts, TLSTimeout, Protocols}
- ], EvHandlerState1};
+ HandshakeEvent = #{
+ stream_ref => RealStreamRef,
+ reply_to => ReplyTo,
+ tls_opts => maps:get(tls_opts, Destination, []),
+ timeout => maps:get(tls_handshake_timeout, Destination, infinity)
+ },
+ {[{origin, <<"https">>, NewHost, NewPort, connect},
+ {tls_handshake, HandshakeEvent, Protocols}], EvHandlerState1};
_ ->
case Protocols of
[http] ->