Skip to content

Conversation

@Rob-Hague
Copy link
Collaborator

The library currently does not check for matching host key algorithms until needed at the end of the key exchange, in contrast to other algorithm types which are checked beforehand. This leads to confusing or uninformative errors, normally from the server (correctly) closing the connection.

This change moves that check alongside the rest of them, and also improves the error messages that arise from no matching algorithms. For example, the error in #1641 (and probably #1636) is now

Renci.SshNet.Common.SshConnectionException: No matching host key algorithm (server offers ssh-dss)

The library currently does not check for matching host key algorithms until needed
at the end of the key exchange, in contrast to other algorithm types which are checked
beforehand. This leads to confusing or uninformative errors, normally from the server
(correctly) closing the connection.

This change moves that check alongside the rest of them, and also improves the error
messages that arise from no matching algorithms.
@Rob-Hague Rob-Hague merged commit caac95c into sshnet:develop Jun 6, 2025
7 of 8 checks passed
@Rob-Hague Rob-Hague deleted the hostkeyalg branch June 6, 2025 05:34
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 this pull request may close these issues.

2 participants