From c2ba2258a0020d82faa3e79162f05fc67d61b53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 25 Jul 2019 14:14:34 +0200 Subject: Add tls_handshake events for CONNECT through TCP proxies --- src/gun_event.erl | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gun_event.erl') 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(), -- cgit v1.2.3