25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-28 16:34:13 +01:00

Merge pull request #184 from weiss/properly-abort-s2s-in

Fix handling of certificate verification errors for incoming s2s connections
This commit is contained in:
Evgeny Khramtsov 2014-04-28 09:58:44 +04:00
commit 68e62d7442

View File

@ -294,15 +294,9 @@ wait_for_stream({xmlstreamstart, _Name, Attrs},
?INFO_MSG("Closing s2s connection: ~s <--> ~s (~s)", ?INFO_MSG("Closing s2s connection: ~s <--> ~s (~s)",
[StateData#state.server, RemoteServer, CertError]), [StateData#state.server, RemoteServer, CertError]),
send_text(StateData, send_text(StateData,
xml:element_to_binary(?SERRT_POLICY_VIOLATION(<<"en">>, <<(xml:element_to_binary(?SERRT_POLICY_VIOLATION(<<"en">>,
CertError))), CertError)))/binary,
{atomic, Pid} = (?STREAM_TRAILER)/binary>>),
ejabberd_s2s:find_connection(jlib:make_jid(<<"">>,
Server, <<"">>),
jlib:make_jid(<<"">>,
RemoteServer,
<<"">>)),
ejabberd_s2s_out:stop_connection(Pid),
{stop, normal, StateData}; {stop, normal, StateData};
{VerifyResult, RemoteServer, Msg} -> {VerifyResult, RemoteServer, Msg} ->
{SASL, NewStateData} = case VerifyResult of {SASL, NewStateData} = case VerifyResult of