Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown when the server SSH identification is missing its"softwareversion" part #822

Closed
chsoft-ag opened this issue May 12, 2021 · 5 comments · Fixed by #1441
Closed

Comments

@chsoft-ag
Copy link

We have actually run into a server in the wild which only provides an identification string of "SSH-2.0-" and omits the "softwareversion" part required by the standard. This leads to SSH.NET throwing an exception

`Renci.SshNet.Common.SshConnectionException: The server response contains a null character at position 0x0000000B:

00000000 53 53 48 2D 32 2E 30 2D 0D 0A 00 SSH-2.0-...

A server must not send a null character before the Protocol Version Exchange is complete.`

I've seen that there had been some discussion about less strict parsing in #749, with a suggestion of a potential strict/lenient property to allow for non-conforming servers that do not provide the software version part. Any thoughts on actually going forward with such a leniency option?

We've contacted the server operator about their non-conformance, but no idea if they have any interest in fixing this as apparently other clients are more forgiving about a missing software version. FileZilla for example connects without issues.

@toxis
Copy link

toxis commented Jan 17, 2023

@chsoft-ag: I have the same issue with an external SFTP provider. Do you find a solution or a workaround?

@chsoft-ag
Copy link
Author

@toxis: In our case, the server was using proprietary software of the server owner and they changed their side to correctly provide the software version. Since that was the only occurrence so far, we had no reason to further look for a fix or workaround.

@doerig
Copy link
Contributor

doerig commented Jul 9, 2024

I came across the same issue, forked the repo and changed the regex for parsing the version string to Version 2 mentioned in #749, looks good now and hope that this tolerant parsing will be incorporated as it is sometimes hard, slow or impossible to make someone change the server configuration.

@Rob-Hague
Copy link
Collaborator

Consider raising a PR?

doerig added a commit to doerig/SSH.NET that referenced this issue Jul 9, 2024
@doerig
Copy link
Contributor

doerig commented Jul 9, 2024

created a PR, reverted back to only a minimal change of the regex, as there where some tests failing with the expression from #749

@Rob-Hague Rob-Hague linked a pull request Jul 10, 2024 that will close this issue
Rob-Hague pushed a commit that referenced this issue Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants