Skip to content

Commit

Permalink
ssl: Enhanche errorhandling, always shutdown gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
IngelaAndin committed Aug 9, 2024
1 parent ca8b893 commit c2a7878
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ssl/src/tls_server_connection_1_3.erl
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,10 @@ do_handle_client_hello(#client_hello{cipher_suites = ClientCiphers,
end
catch
{Ref, #alert{} = Alert} ->
Alert
Alert;
error:Reason:ST ->
?SSL_LOG(debug, handshake_error, [{reason, Reason}, {stacktrace, ST}]),
?ALERT_REC(?ILLEGAL_PARAMETER, illegal_parameter_in_client_hello)
end.

send_hello_flight({start_handshake, PSK0},
Expand Down Expand Up @@ -580,7 +583,8 @@ send_hello_flight({start_handshake, PSK0},
catch
{Ref, #alert{} = Alert} ->
Alert;
error:badarg ->
error:Reason:ST ->
?SSL_LOG(debug, crypto_error, [{reason, Reason}, {stacktrace, ST}]),
?ALERT_REC(?ILLEGAL_PARAMETER, illegal_parameter_to_compute_key)
end.

Expand Down

0 comments on commit c2a7878

Please sign in to comment.