1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 09:39:39 +02:00

Throw an XMPPException if SASL authentication fails. SMACK-89

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2817 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2005-09-13 20:05:29 +00:00 committed by gato
parent bb0a864be9
commit 283b0f33f5
3 changed files with 73 additions and 11 deletions

View file

@ -316,8 +316,15 @@ class PacketReader {
resetParser();
}
else if (parser.getName().equals("failure")) {
// TLS negotiation has failed so close the connection.
throw new Exception("TLS negotiation has failed");
if ("urn:ietf:params:xml:ns:xmpp-tls".equals(parser.getNamespace(null))) {
// TLS negotiation has failed. The server will close the connection
throw new Exception("TLS negotiation has failed");
}
else {
// SASL authentication has failed. The server may close the connection
// depending on the number of retries
connection.getSASLAuthentication().authenticationFailed();
}
}
else if (parser.getName().equals("challenge")) {
// The server is challenging the SASL authentication made by the client