diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 5fc9dc6d..a448c30e 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1190,8 +1190,8 @@ class SSH2 $this->errors[] = utf8_decode($data); } - if ($matches[3] != '1.99' && $matches[3] != '2.0') { - throw new \RuntimeException("Cannot connect to SSH $matches[1] servers"); + if (version_compare($matches[3], '1.99', '<')) { + throw new \RuntimeException("Cannot connect to SSH $matches[3] servers"); } if (!$this->send_id_string_first) {