CloudNetService / CloudNet

A modern application that can dynamically and easily deliver Minecraft oriented software
https://cloudnetservice.eu
Apache License 2.0
369 stars 115 forks source link

fix: update sshj to 0.38.0 and fix heartbeat issue #1360

Closed derklaro closed 4 months ago

derklaro commented 4 months ago

Motivation

SSHJ released a new version (0.38.0) in which they improved their support for strict key exchanges. Unfortunately this also introduced a bug on their end, as the hearbeater is writing packets to the server which aren't allowed during key exchange (KEX_INIT must be the first packet, however due to the hearbeater an IGNORE packet is the first leading to the error strict KEX violation: KEXINIT was not the first packet).

Modification

Bump SSHJ to 0.38.0 and write a custom heartbeater which checks if the key exchange is done before sending heartbeat packets.

Result

SSHJ is updated to 0.38.0 and everything works as expected again.