aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2010-02-18 08:49:03 +0000
committerErlang/OTP <[email protected]>2010-02-18 08:49:03 +0000
commitab0b0787b2d5f2f676e529848544fb6988a400dc (patch)
tree29b952856e72600c3a93104828b22d0696ef8e02
parent40851255dcb18095b453ea175faacccbc7bed3e6 (diff)
downloadotp-ab0b0787b2d5f2f676e529848544fb6988a400dc.tar.gz
otp-ab0b0787b2d5f2f676e529848544fb6988a400dc.tar.bz2
otp-ab0b0787b2d5f2f676e529848544fb6988a400dc.zip
Avoid crash when trying to alert the user.
-rw-r--r--lib/ssl/src/ssl_connection.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index eaa022ed29..4847fd278d 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -1730,15 +1730,19 @@ handle_own_alert(Alert, Version, StateName,
role = Role,
connection_states = ConnectionStates,
log_alert = Log}) ->
- try
+ try %% Try to tell the other side
{BinMsg, _} =
encode_alert(Alert, Version, ConnectionStates),
Transport:send(Socket, BinMsg)
catch _:_ -> %% Can crash if we are in a uninitialized state
ignore
end,
- log_alert(Log, StateName, Alert),
- alert_user(User, Alert, Role).
+ try %% Try to tell the local user
+ log_alert(Log, StateName, Alert),
+ alert_user(User, Alert, Role)
+ catch _:_ ->
+ ok
+ end.
make_premaster_secret({MajVer, MinVer}) ->
Rand = crypto:rand_bytes(?NUM_OF_PREMASTERSECRET_BYTES-2),