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

View file

@ -395,9 +395,11 @@ 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");
if (!iterator.hasNext()) {
throw new StateChangingException(Account.State.TLS_ERROR); throw new StateChangingException(Account.State.TLS_ERROR);
} }
} }
}
if (startXmpp(localSocket)) { if (startXmpp(localSocket)) {
break; // successfully connected to server that speaks xmpp break; // successfully connected to server that speaks xmpp
} else { } else {