Skip to content

Commit 514fd03

Browse files
Anthony.MeehanAnthony.Meehan
authored andcommitted
Handle SSH_MSG_GLOBAL_REQUEST earlier in the connection process
1 parent 28a1892 commit 514fd03

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Renci.SshNet/Session.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,9 @@ public void Connect()
594594

595595
// Some server implementations might sent this message first, prior establishing encryption algorithm
596596
RegisterMessage("SSH_MSG_USERAUTH_BANNER");
597+
598+
// Modern versions of OpenSSH server use this generic message for various proprietary extensions of the SSH protocol.
599+
RegisterMessage("SSH_MSG_GLOBAL_REQUEST");
597600

598601
// mark the message listener threads as started
599602
_messageListenerCompleted.Reset();
@@ -626,7 +629,6 @@ public void Connect()
626629
_isAuthenticated = true;
627630

628631
// Register Connection messages
629-
RegisterMessage("SSH_MSG_GLOBAL_REQUEST");
630632
RegisterMessage("SSH_MSG_REQUEST_SUCCESS");
631633
RegisterMessage("SSH_MSG_REQUEST_FAILURE");
632634
RegisterMessage("SSH_MSG_CHANNEL_OPEN_CONFIRMATION");

0 commit comments

Comments
 (0)