do not require starttls when connecting over to .onion domain

This commit is contained in:
Daniel Gultsch 2019-01-25 08:48:46 +01:00
parent 8fbe445c99
commit 18807305c1

View file

@ -260,7 +260,7 @@ public class XmppConnection implements Runnable {
final boolean extended = mXmppConnectionService.showExtendedConnectionOptions(); final boolean extended = mXmppConnectionService.showExtendedConnectionOptions();
if (useTor) { if (useTor) {
String destination; String destination;
if (account.getHostname().isEmpty()) { if (account.getHostname().isEmpty() || account.isOnion()) {
destination = account.getServer(); destination = account.getServer();
} else { } else {
destination = account.getHostname(); destination = account.getHostname();
@ -839,7 +839,7 @@ public class XmppConnection implements Runnable {
private void processStreamFeatures(final Tag currentTag) throws XmlPullParserException, IOException { private void processStreamFeatures(final Tag currentTag) throws XmlPullParserException, IOException {
this.streamFeatures = tagReader.readElement(currentTag); 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); final boolean needsBinding = !isBound && !account.isOptionSet(Account.OPTION_REGISTER);
if (this.streamFeatures.hasChild("starttls") && !features.encryptionEnabled) { if (this.streamFeatures.hasChild("starttls") && !features.encryptionEnabled) {
sendStartTLS(); sendStartTLS();