forked from mirror/monocles_chat_clean
use ascii notation for punycode domains in SNI
(cherry picked from commit b6d62c13effb3edb20a6b88b3b9f9e465bd0d8d1)
This commit is contained in:
parent
ee32c427af
commit
200ebe887a
1 changed files with 2 additions and 1 deletions
|
@ -18,6 +18,7 @@ import java.io.ByteArrayInputStream;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.net.IDN;
|
||||
import java.net.InetAddress;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.MalformedURLException;
|
||||
|
@ -856,7 +857,7 @@ public class XmppConnection implements Runnable {
|
|||
final InetAddress address = socket.getInetAddress();
|
||||
final SSLSocket sslSocket = (SSLSocket) tlsFactoryVerifier.factory.createSocket(socket, address.getHostAddress(), socket.getPort(), true);
|
||||
SSLSocketHelper.setSecurity(sslSocket);
|
||||
SSLSocketHelper.setHostname(sslSocket, account.getServer());
|
||||
SSLSocketHelper.setHostname(sslSocket, IDN.toASCII(account.getServer()));
|
||||
SSLSocketHelper.setApplicationProtocol(sslSocket, "xmpp-client");
|
||||
if (!tlsFactoryVerifier.verifier.verify(account.getServer(), this.verifiedHostname, sslSocket.getSession())) {
|
||||
Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": TLS certificate verification failed");
|
||||
|
|
Loading…
Add table
Reference in a new issue