mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
Report some TLS errors
This commit is contained in:
parent
0aa22e5149
commit
d0a185f2d9
2 changed files with 18 additions and 2 deletions
|
@ -275,6 +275,12 @@ process_terminated(#{sockmod := SockMod, socket := Socket, jid := JID} = State,
|
||||||
end,
|
end,
|
||||||
bounce_message_queue(),
|
bounce_message_queue(),
|
||||||
State1;
|
State1;
|
||||||
|
process_terminated(#{sockmod := SockMod, socket := Socket,
|
||||||
|
stop_reason := {tls, no_certfile}} = State, Reason) ->
|
||||||
|
%% TODO: we probably need to report more TLS errors here
|
||||||
|
?ERROR_MSG("(~s) Failed to secure c2s connection: ~s",
|
||||||
|
[SockMod:pp(Socket), format_reason(State, Reason)]),
|
||||||
|
State;
|
||||||
process_terminated(State, _Reason) ->
|
process_terminated(State, _Reason) ->
|
||||||
State.
|
State.
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,8 @@ handle_stream_start(_StreamStart, #{lserver := LServer} = State) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
handle_stream_end(Reason, #{server_host := LServer} = State) ->
|
handle_stream_end(Reason, #{server_host := LServer} = State) ->
|
||||||
ejabberd_hooks:run_fold(s2s_in_closed, LServer, State, [Reason]).
|
State1 = State#{stop_reason => Reason},
|
||||||
|
ejabberd_hooks:run_fold(s2s_in_closed, LServer, State1, [Reason]).
|
||||||
|
|
||||||
handle_stream_established(State) ->
|
handle_stream_established(State) ->
|
||||||
set_idle_timeout(State#{established => true}).
|
set_idle_timeout(State#{established => true}).
|
||||||
|
@ -284,7 +285,16 @@ handle_cast(Msg, #{server_host := LServer} = State) ->
|
||||||
handle_info(Info, #{server_host := LServer} = State) ->
|
handle_info(Info, #{server_host := LServer} = State) ->
|
||||||
ejabberd_hooks:run_fold(s2s_in_handle_info, LServer, State, [Info]).
|
ejabberd_hooks:run_fold(s2s_in_handle_info, LServer, State, [Info]).
|
||||||
|
|
||||||
terminate(Reason, #{auth_domains := AuthDomains}) ->
|
terminate(Reason, #{auth_domains := AuthDomains,
|
||||||
|
sockmod := SockMod, socket := Socket} = State) ->
|
||||||
|
case maps:get(stop_reason, State, undefined) of
|
||||||
|
{tls, no_certfile} = Err ->
|
||||||
|
%% TODO: we probably need to report more TLS errors here
|
||||||
|
?ERROR_MSG("(~s) Failed to secure inbound s2s connection: ~s",
|
||||||
|
[SockMod:pp(Socket), xmpp_stream_in:format_error(Err)]);
|
||||||
|
_ ->
|
||||||
|
ok
|
||||||
|
end,
|
||||||
case Reason of
|
case Reason of
|
||||||
{process_limit, _} ->
|
{process_limit, _} ->
|
||||||
sets:fold(
|
sets:fold(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue