aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_event.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-07-25 14:14:34 +0200
committerLoïc Hoguin <[email protected]>2019-07-25 14:14:34 +0200
commitc2ba2258a0020d82faa3e79162f05fc67d61b53e (patch)
treec812564c3896e1c2489b8c70bff0adc9d68e2867 /src/gun_event.erl
parent293ca3d58f64cd716e8b1f84330c29f229d5a4f2 (diff)
downloadgun-c2ba2258a0020d82faa3e79162f05fc67d61b53e.tar.gz
gun-c2ba2258a0020d82faa3e79162f05fc67d61b53e.tar.bz2
gun-c2ba2258a0020d82faa3e79162f05fc67d61b53e.zip
Add tls_handshake events for CONNECT through TCP proxies
Diffstat (limited to 'src/gun_event.erl')
-rw-r--r--src/gun_event.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gun_event.erl b/src/gun_event.erl
index c87af58..ed50fd7 100644
--- a/src/gun_event.erl
+++ b/src/gun_event.erl
@@ -55,8 +55,20 @@
-callback connect_end(connect_event(), State) -> State.
%% tls_handshake_start/tls_handshake_end.
+%%
+%% These events occur when connecting to a TLS server or when
+%% upgrading the connection to use TLS, for example using CONNECT.
+%% The stream_ref/reply_to values are only present when the TLS
+%% handshake occurs as a result of a request.
+%%
+%% @todo The current implementation of TLS over TLS will not result
+%% in an event being triggered when the TLS handshake fails. Instead
+%% the Gun process will exit because of the link to the gun_tls_proxy
+%% process.
-type tls_handshake_event() :: #{
+ stream_ref => reference(),
+ reply_to => pid(),
socket := inet:socket() | ssl:sslsocket(), %% The socket before/after will be different.
tls_opts := [ssl:connect_option()],
timeout := timeout(),