From ab0b0787b2d5f2f676e529848544fb6988a400dc Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 18 Feb 2010 08:49:03 +0000 Subject: Avoid crash when trying to alert the user. --- lib/ssl/src/ssl_connection.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') 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), -- cgit v1.2.3