aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to '')
-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");