From a53f01ed7adaf3cd0e39c3c313d3427b2f978f2f Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 27 Jan 2019 12:44:04 +0100 Subject: do not require starttls when connecting over to .onion domain --- src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 705a3178d..2c736493e 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -286,7 +286,7 @@ public class XmppConnection implements Runnable { } } else if (useTor) { String destination; - if (account.getHostname().isEmpty()) { + if (account.getHostname().isEmpty() || account.isOnion()) { destination = account.getServer(); } else { destination = account.getHostname(); @@ -866,7 +866,7 @@ public class XmppConnection implements Runnable { private void processStreamFeatures(final Tag currentTag) throws XmlPullParserException, IOException { this.streamFeatures = tagReader.readElement(currentTag); - final boolean isSecure = features.encryptionEnabled || Config.ALLOW_NON_TLS_CONNECTIONS; + final boolean isSecure = features.encryptionEnabled || Config.ALLOW_NON_TLS_CONNECTIONS || account.isOnion(); final boolean needsBinding = !isBound && !account.isOptionSet(Account.OPTION_REGISTER); if (this.streamFeatures.hasChild("starttls") && !features.encryptionEnabled) { sendStartTLS(); -- cgit v1.2.3