I get a invalid digest error when connecting to a SFTP server but only with a particular key and server combination #1662
Unanswered
markbeazley
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I think this is due to the switch to System.Security.Cryptography and I think some choice of algorithm ending up picking one that isn't supported I think rsa-sha1. I think the other server that works must be triggering a different algorithm which exists and works. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Not sure if this is an actual issue with SSH.NET or not, but I'm a bit stumped at figuring out what exactly is going wrong. I suspect it might be some issue with the SSH/SFTP server itself as its
SSH-2.0-OpenSSH_for_Windows_8.6
but I'm not getting the same issues using the command line sftp program on my linux development machine.I am trying to connect to the above SFTP server with SSH.NET, using a private key file )4096-bit RSA with no password), I get this error/stack trace, when I call Connect() on the client
I can connect to the server fine if I use a username and password, or if I use a ssh key provided by GPG using a GPG key stored on a hardware token using the AGENT protocol with this library so I don't think its a problem with SSH.NET and the server itself,.
So this made me think it was an issue with the key, so I set up a linux machine locally, added the public key to it, and SSH.NET was able to connect fine using the same private key.
After this I tested connecting to the original server using the sftp command in linux with that private key and it works.
Which shows the error only happens when using this one key, this one server and SSH.NET. Presumably some subtle algorithm/config difference in SSH.NET/the .net Crypto libraries vs the linux command line tools on my computer.
Edit:
Just tested rolling back to 2024.0.0 from 2025.0.0 and it all works, so must be some change between the two.
Edit 2:
Narrowed down to a change in 2024.1.0 not sure what exactly though.
Edit 3:
Still happening as of 2025.0.1-prerelease.17
Beta Was this translation helpful? Give feedback.
All reactions