From edb28ccb31087f61eaa5be4ba25808efeb158bbc Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 11 Jul 2017 23:25:59 +0200 Subject: [PATCH] throw state changing exception on failed tls only if no more connection options left --- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index c49eb82f5..ee82ef512 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -395,7 +395,9 @@ public class XmppConnection implements Runnable { if (!tlsFactoryVerifier.verifier.verify(account.getServer().getDomainpart(), ((SSLSocket) localSocket).getSession())) { 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)) {