From 12ae70b2659772a591000c378802e94e19f48829 Mon Sep 17 00:00:00 2001
From: Vitaly Takmazov
Date: Mon, 30 Jul 2018 16:26:06 +0300
Subject: XMPP: trying to report STARTTLS failure before closing socket
---
juick-server/src/main/java/com/juick/server/XMPPServer.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'juick-server')
diff --git a/juick-server/src/main/java/com/juick/server/XMPPServer.java b/juick-server/src/main/java/com/juick/server/XMPPServer.java
index 643bc37b..9dc7bf0a 100644
--- a/juick-server/src/main/java/com/juick/server/XMPPServer.java
+++ b/juick-server/src/main/java/com/juick/server/XMPPServer.java
@@ -310,7 +310,7 @@ public class XMPPServer implements ConnectionListener, AutoCloseable {
connection.sendStanza("");
try {
connection.setSocket(sc.getSocketFactory().createSocket(connection.getSocket(), connection.getSocket().getInetAddress().getHostAddress(),
- connection.getSocket().getPort(), true));
+ connection.getSocket().getPort(), false));
SSLSocket sslSocket = (SSLSocket) connection.getSocket();
sslSocket.addHandshakeCompletedListener(handshakeCompletedEvent -> {
try {
@@ -330,7 +330,7 @@ public class XMPPServer implements ConnectionListener, AutoCloseable {
connection.restartParser();
} catch (XmlPullParserException | IOException sex) {
logger.warn("stream {} ssl error {}", connection.streamID, sex);
- connection.sendStanza("");
+ connection.sendStanza("");
removeConnectionIn(connection);
connection.closeConnection();
}
@@ -341,7 +341,7 @@ public class XMPPServer implements ConnectionListener, AutoCloseable {
try {
Socket socket = outConnections.get(connection).get();
socket = sc.getSocketFactory().createSocket(socket, socket.getInetAddress().getHostAddress(),
- socket.getPort(), true);
+ socket.getPort(), false);
SSLSocket sslSocket = (SSLSocket) socket;
sslSocket.addHandshakeCompletedListener(handshakeCompletedEvent -> {
try {
@@ -363,7 +363,7 @@ public class XMPPServer implements ConnectionListener, AutoCloseable {
connection.sendOpenStream();
} catch (NoSuchElementException | XmlPullParserException | IOException sex) {
logger.error("s2s ssl error: {} {}, error {}", connection.to, connection.getStreamID(), sex);
- connection.send("");
+ connection.send("");
removeConnectionOut(connection);
connection.logoff();
}
--
cgit v1.2.3