From b5bc7d8d9f1a03498d380493c0d4ed51923007e2 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 9 Apr 2018 08:18:13 +0200 Subject: [PATCH] Use XMPP service name when creating the TLS socket instead of the hostname. This should make SNI also to use the XMPP service name instead of the hostname. Fixes SMACK-813. --- .../main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index 33bf2845e..ffa79c341 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -795,7 +795,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { Socket plain = socket; // Secure the plain connection socket = context.getSocketFactory().createSocket(plain, - host, plain.getPort(), true); + config.getXMPPServiceDomain().toString(), plain.getPort(), true); final SSLSocket sslSocket = (SSLSocket) socket; // Immediately set the enabled SSL protocols and ciphers. See SMACK-712 why this is