From 51d3c3176638eb7e9e08e6facf71d589bc2ccb04 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 8 Jan 2017 22:58:23 +0100 Subject: [PATCH] Initialize Socket in TCP connection when proxy is used Thanks to Grigory Fedorov for reporting this. --- .../main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 1 + 1 file changed, 1 insertion(+) 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 4d67ad567..92a2ba631 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 @@ -594,6 +594,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { } failedAddresses.add(hostAddress); } else { + socket = socketFactory.createSocket(); StringUtils.requireNotNullOrEmpty(host, "Host of HostAddress " + hostAddress + " must not be null when using a Proxy"); final String hostAndPort = host + " at port " + port; LOGGER.finer("Trying to establish TCP connection via Proxy to " + hostAndPort);