Skip to content

Commit

Permalink
Merge branch 'ingela/ssl/alerts-enhancements/GH-8482/OTP-19092' into …
Browse files Browse the repository at this point in the history
…maint

* ingela/ssl/alerts-enhancements/GH-8482/OTP-19092:
  ssl: Enhance ALERT logs to help understand what causes the alert.
  • Loading branch information
IngelaAndin committed May 24, 2024
2 parents ef44167 + 0ba6530 commit f81c899
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/ssl/src/ssl_handshake.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2157,27 +2157,26 @@ maybe_check_hostname(_, valid, _, _) ->
path_validation_alert({bad_cert, cert_expired}) ->
?ALERT_REC(?FATAL, ?CERTIFICATE_EXPIRED);
path_validation_alert({bad_cert, invalid_issuer}) ->
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE);
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE, invalid_issuer);
path_validation_alert({bad_cert, invalid_signature}) ->
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE);
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE, invalid_signature);
path_validation_alert({bad_cert, unsupported_signature}) ->
?ALERT_REC(?FATAL, ?UNSUPPORTED_CERTIFICATE);
?ALERT_REC(?FATAL, ?UNSUPPORTED_CERTIFICATE, unsupported_signature);
path_validation_alert({bad_cert, name_not_permitted}) ->
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE);
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE, name_not_permitted);
path_validation_alert({bad_cert, unknown_critical_extension}) ->
?ALERT_REC(?FATAL, ?UNSUPPORTED_CERTIFICATE);
?ALERT_REC(?FATAL, ?UNSUPPORTED_CERTIFICATE, unknown_critical_extension);
path_validation_alert({bad_cert, {revoked, _}}) ->
?ALERT_REC(?FATAL, ?CERTIFICATE_REVOKED);
path_validation_alert({bad_cert, {revocation_status_undetermined, Details}}) ->
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE, Details);
path_validation_alert({bad_cert, selfsigned_peer}) ->
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE);
?ALERT_REC(?FATAL, ?BAD_CERTIFICATE, selfsigned_peer);
path_validation_alert({bad_cert, unknown_ca}) ->
?ALERT_REC(?FATAL, ?UNKNOWN_CA);
path_validation_alert(Reason) ->
?ALERT_REC(?FATAL, ?HANDSHAKE_FAILURE, Reason).


digitally_signed(Version, Msg, HashAlgo, PrivateKey, SignAlgo) ->
try do_digitally_signed(Version, Msg, HashAlgo, PrivateKey, SignAlgo)
catch
Expand Down

0 comments on commit f81c899

Please sign in to comment.