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

ssh: handshake failed: knownhosts: key mismatch #18

Open
trotterdylan opened this issue Aug 22, 2022 · 0 comments
Open

ssh: handshake failed: knownhosts: key mismatch #18

trotterdylan opened this issue Aug 22, 2022 · 0 comments

Comments

@trotterdylan
Copy link
Contributor

This error can happen when performing git remote operations (e.g. a push) on a remote configured with ssh. It seems like this is caused by multiple github.com entries in known_hosts, one of which uses an unsupported key or algorithm: https://github.blog/2021-09-01-improving-git-protocol-security-github/

In this case the Git library (or the underlying SSH library) naively picks the first key, which may not work. Instead of trying other supported keys, the Dial call fails. This has been noted in go-git issue 411 and Golang issue 29286.

A PR that I believe addresses this has been written for go-git, but it hasn't yet been accepted: go-git/go-git#548

I'd rather not fork go-git and instead try to patch the way that we configure SSH auth, but it's not immediately clear how easy this will be.

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

No branches or pull requests

1 participant