Don't send keep alive signals before kex is done (#934)

Otherwise, they could interfere with strict key exchange.

Co-authored-by: Jeroen van Erp <jeroen@hierynomus.com>
This commit is contained in:
Henning Pöttker
2024-04-15 09:29:06 +02:00
committed by GitHub
parent 70af58d199
commit 81d77d277c
2 changed files with 50 additions and 8 deletions

View File

@@ -804,12 +804,12 @@ public class SSHClient
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();
}
/**