From 18807305c121d94029a442d8257c2f3258a36aad Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 25 Jan 2019 08:48:46 +0100 Subject: [PATCH] do not require starttls when connecting over to .onion domain --- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index d03e9cbe4..1cb046495 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -260,7 +260,7 @@ public class XmppConnection implements Runnable { final boolean extended = mXmppConnectionService.showExtendedConnectionOptions(); if (useTor) { String destination; - if (account.getHostname().isEmpty()) { + if (account.getHostname().isEmpty() || account.isOnion()) { destination = account.getServer(); } else { destination = account.getHostname(); @@ -839,7 +839,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();