summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngela Anderton Andin <ingela@erlang.org>2023-05-07 11:17:37 +0200
committerIngela Anderton Andin <ingela@erlang.org>2023-05-08 09:17:34 +0200
commit0c4e0f40a803412921241c3cb460045e7207180d (patch)
tree7e93818494ae8fcfe1a214670e5d6eb8dbfa9dcb
parent36a02676a4c30d915518453a2664b8338fd46d85 (diff)
downloaderlang-0c4e0f40a803412921241c3cb460045e7207180d.tar.gz
ssl: Improve error information when middlebox assert fails
-rw-r--r--lib/ssl/src/tls_client_connection_1_3.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ssl/src/tls_client_connection_1_3.erl b/lib/ssl/src/tls_client_connection_1_3.erl
index d5742ea390..8f7486d419 100644
--- a/lib/ssl/src/tls_client_connection_1_3.erl
+++ b/lib/ssl/src/tls_client_connection_1_3.erl
@@ -316,6 +316,10 @@ hello_middlebox_assert(enter, _, State) ->
{keep_state, State};
hello_middlebox_assert(internal, #change_cipher_spec{}, State) ->
tls_gen_connection:next_event(wait_ee, no_record, State);
+hello_middlebox_assert(internal = Type, #encrypted_extensions{} = Msg, #state{ssl_options = #{log_level := Level}} = State) ->
+ ssl_logger:log(warning, Level, #{description => "Failed to assert middlebox server message",
+ reason => [{missing, #change_cipher_spec{}}]}, ?LOCATION),
+ ssl_gen_statem:handle_common_event(Type, Msg, ?FUNCTION_NAME, State);
hello_middlebox_assert(info, Msg, State) ->
tls_gen_connection:handle_info(Msg, ?FUNCTION_NAME, State);
hello_middlebox_assert(Type, Msg, State) ->
@@ -331,8 +335,10 @@ hello_retry_middlebox_assert(enter, _, State) ->
{keep_state, State};
hello_retry_middlebox_assert(internal, #change_cipher_spec{}, State) ->
tls_gen_connection:next_event(wait_sh, no_record, State);
-hello_retry_middlebox_assert(internal, #server_hello{}, State) ->
- tls_gen_connection:next_event(?FUNCTION_NAME, no_record, State, [postpone]);
+hello_retry_middlebox_assert(internal = Type, #server_hello{} = Msg, #state{ssl_options = #{log_level := Level}} = State) ->
+ ssl_logger:log(warning, Level, #{description => "Failed to assert middlebox server message",
+ reason => [{missing, #change_cipher_spec{}}]}, ?LOCATION),
+ ssl_gen_statem:handle_common_event(Type, Msg, ?FUNCTION_NAME, State);
hello_retry_middlebox_assert(info, Msg, State) ->
tls_gen_connection:handle_info(Msg, ?FUNCTION_NAME, State);
hello_retry_middlebox_assert(Type, Msg, State) ->