-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Reproduction steps
Attempt to fetch an SSH repository from github.com with a version of ssh2 that is built on Windows with the WinCNG backend. You will need to have the 3 github.com keys in your known_hosts file (ssh-ed25519, ssh-rsa, ecdsa-sha2-nistp256), and importantly the ssh-rsa key should not be first.
Expected behavior
Fetching should be successful.
Also, I feel like the order of the known_hosts keys should not be relevant. Perhaps this is a limitation of ssh2, but I believe this isn't an issue with OpenSSH.
Actual behavior
The error is:
failed to set hostkey preference: The requested method(s) are not currently supported
The issue is that the WinCNG backend does not support ED25519 or ECDSA. The code that sets the key preference here does not know that.
Perhaps it could loop over the available keys until libssh2_session_method_pref
doesn't fail?
Workaround
A workaround is to use the OpenSSL backend.
Version of libgit2 (release number or SHA1)
1.5.1
Operating system(s) tested
Windows 10 Pro, Windows Server 2022