-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo update
demands an ecdsa key for github.com
#11921
Comments
The error you are getting is likely since #11556 , but before that PR it probably also just used ECDSA keys, just not verifying them at all. I think the problem is that cargo does not read |
I guess it's also because libgit2 only gets one remote key type at a time, and the It seems a bit difficult to fix in either Cargo or git2-rs. I see it as an issue of upstream libgit2. |
libssh2 does not read OpenSSH config files at all. If you need extra SSH configuration support, I recommend using |
@ehuss The issue is not with OpenSSH config files, but rather with the choice of the host key algorithm by the ssh client embedded in cargo. I do not need any extra SSH configuration support. @est31 Likewise, the only reason I mentioned |
Ah, I see. This should be fixed when cargo gets updated on nightly (should be within a few days). The SSH handler was not setting the preferred host key algorithm before negotiation, so it was using whatever the server preferred. The next update will use the known_hosts file to determine which algorithms are preferred. |
The fix is available on nightly since |
Problem
Since recently,
cargo update
started to complain about an unknown SSH host key for github.com, suggesting that github's ecdsa key be added to known_hosts:(I traced this down to my local configuration that disables ECDSA host key algorithms in
HostKeysAlgorithm
, thus causing regular OpenSSH client to automatically remove any ECDSA keys from known_hosts, together with a configuration that rewrites HTTPS github.com URLs to ssh ones.)However, I have other perfectly valid keys for github.com in my known_hosts.
cargo
should use them instead of demanding a host key in a specific cryptographic system and failing if one is not available.Steps
~/.ssh/known_hosts
and add GitHub keys to it, skipping the ECDSA key:cargo
request that contacts GitHub over ssh (e. g. add an insteadOf statement in your.gitconfig
, drop the registry index cache and do a search):Possible Solution(s)
Depending on the actual implementation details: either do not force cargo's built-in SSH client to use a specific cryptosystem for verifying host keys, or do not make it a hard error if a specific host key is not available (but others are).
Notes
No response
Version
The text was updated successfully, but these errors were encountered: