Merge pull request #181 from weiss/check-tls-before-auth

Check TLS state before requesting SASL EXTERNAL for outgoing s2s connections
This commit is contained in:
Evgeny Khramtsov 2014-04-30 00:36:08 +04:00
commit 8419322884
1 changed files with 3 additions and 1 deletions

View File

@ -600,7 +600,9 @@ wait_for_features({xmlstreamelement, El}, StateData) ->
{next_state, stream_established,
StateData#state{queue = queue:new()}};
SASLEXT and StateData#state.try_auth and
(StateData#state.new /= false) ->
(StateData#state.new /= false) and
(StateData#state.tls_enabled or
not StateData#state.tls_required) ->
send_element(StateData,
#xmlel{name = <<"auth">>,
attrs =