From 61600d5a17066724a5722cc2a2b47b22659c0939 Mon Sep 17 00:00:00 2001 From: James Thorpe Date: Sun, 2 Nov 2025 11:59:58 +1100 Subject: [PATCH] Support SSH-1.99 version Early SSH 2.0 implementations often used version 1.99 to indicated SSH 2.0 with fallback to SSH 1.0. These should be treated as SSH 2.0 for the purposes of this library. --- lib/src/ssh_transport.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/ssh_transport.dart b/lib/src/ssh_transport.dart index 46ba5e4..2e6f61c 100644 --- a/lib/src/ssh_transport.dart +++ b/lib/src/ssh_transport.dart @@ -373,7 +373,7 @@ class SSHTransport { } final versionString = bufferString.substring(0, index); - if (!versionString.startsWith('SSH-2.0-')) { + if (!(versionString.startsWith('SSH-2.0-') || versionString.startsWith('SSH-1.99-'))) { socket.sink.add(latin1.encode('Protocol mismatch\r\n')); throw SSHHandshakeError('Invalid version: $versionString'); }