From 8c2c04e7aa7f83444ae55e8937052f2340f92b6d Mon Sep 17 00:00:00 2001 From: Raul Santelices Date: Thu, 9 Nov 2023 17:12:43 -0500 Subject: [PATCH] Fix for issue #910: Bad packet received by server when hearbeat is enabled --- src/main/java/net/schmizz/sshj/SSHClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/schmizz/sshj/SSHClient.java b/src/main/java/net/schmizz/sshj/SSHClient.java index dd0e3817..78b91c5f 100644 --- a/src/main/java/net/schmizz/sshj/SSHClient.java +++ b/src/main/java/net/schmizz/sshj/SSHClient.java @@ -804,12 +804,12 @@ protected void onConnect() throws IOException { super.onConnect(); trans.init(getRemoteHostname(), getRemotePort(), getInputStream(), getOutputStream()); + doKex(); final KeepAlive keepAliveThread = conn.getKeepAlive(); if (keepAliveThread.isEnabled()) { ThreadNameProvider.setThreadName(conn.getKeepAlive(), trans); keepAliveThread.start(); } - doKex(); } /**