aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-10-02 21:55:18 +0200
committerChristian Schneppe <christian@pix-art.de>2018-10-02 21:55:18 +0200
commitf162458323365bdd2a8aa0a1a97e5a79753ccf0d (patch)
treee5b6e834a10e4631eeae5df46c8192d80d5abe9f /src/main
parent337fdf93f35e427ef4035c24b363e3c9da45c64b (diff)
use sni and alpn for start tls as well. apperently google requires it
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/utils/TLSSocketFactory.java2
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/XmppConnection.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/TLSSocketFactory.java b/src/main/java/de/pixart/messenger/utils/TLSSocketFactory.java
index 84b361dea..6daa9ac9b 100644
--- a/src/main/java/de/pixart/messenger/utils/TLSSocketFactory.java
+++ b/src/main/java/de/pixart/messenger/utils/TLSSocketFactory.java
@@ -23,7 +23,7 @@ public class TLSSocketFactory extends SSLSocketFactory {
}
private static Socket enableTLSOnSocket(Socket socket) {
- if (socket != null && (socket instanceof SSLSocket)) {
+ if (socket instanceof SSLSocket) {
SSLSocketHelper.setSecurity((SSLSocket) socket);
}
return socket;
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
index bb4edda5c..cd2a13bd4 100644
--- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java
@@ -875,6 +875,8 @@ public class XmppConnection implements Runnable {
}
SSLSocketHelper.setSecurity(sslSocket);
+ SSLSocketHelper.setHostname(sslSocket, 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");