throw state changing exception on failed tls only if no more connection options left

This commit is contained in:
Daniel Gultsch 2017-07-11 23:25:59 +02:00
parent 19c1484053
commit edb28ccb31
1 changed files with 3 additions and 1 deletions

View File

@ -395,7 +395,9 @@ public class XmppConnection implements Runnable {
if (!tlsFactoryVerifier.verifier.verify(account.getServer().getDomainpart(), ((SSLSocket) localSocket).getSession())) { if (!tlsFactoryVerifier.verifier.verify(account.getServer().getDomainpart(), ((SSLSocket) localSocket).getSession())) {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": TLS certificate verification failed"); Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": TLS certificate verification failed");
throw new StateChangingException(Account.State.TLS_ERROR); if (!iterator.hasNext()) {
throw new StateChangingException(Account.State.TLS_ERROR);
}
} }
} }
if (startXmpp(localSocket)) { if (startXmpp(localSocket)) {