diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-08-01 11:46:11 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-08-01 11:46:11 +0200 |
commit | 8cf22e633d4fdff7714b72ff0ff0eea3ea919868 (patch) | |
tree | e528aa90d7d675d3ca65bc9cb676bdadaa40977c /src/main | |
parent | 6bb9c9ce3b714b18a99dbecbb10505f4adbd7118 (diff) |
work around idn short comings in minidns
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/Resolver.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/Resolver.java b/src/main/java/de/pixart/messenger/utils/Resolver.java index 528b4882c..29b55d592 100644 --- a/src/main/java/de/pixart/messenger/utils/Resolver.java +++ b/src/main/java/de/pixart/messenger/utils/Resolver.java @@ -79,7 +79,7 @@ public class Resolver { } List<Result> list = new ArrayList<>(); try { - ResolverResult<D> results = resolveWithFallback(srv.name, type, !authenticated); + ResolverResult<D> results = resolveWithFallback(DNSName.from(srv.name.toString()), type, !authenticated); for (D record : results.getAnswersOrEmptySet()) { Result resolverResult = Result.fromRecord(srv, directTls); resolverResult.authenticated = results.isAuthenticData() && authenticated; diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 354065c0e..46dbf9a18 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; import java.net.ConnectException; +import java.net.IDN; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; @@ -396,7 +397,7 @@ public class XmppConnection implements Runnable { + ": using values from dns " + result.getHostname().toString() + "/" + result.getIp().getHostAddress() + ":" + result.getPort() + " tls: " + features.encryptionEnabled); } else { - addr = new InetSocketAddress(result.getHostname().toString(), result.getPort()); + addr = new InetSocketAddress(IDN.toASCII(result.getHostname().toString()), result.getPort()); Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": using values from dns " + result.getHostname().toString() + ":" + result.getPort() + " tls: " + features.encryptionEnabled); |