Skip to content

Commit 8681a5a

Browse files
committed
Auto merge of #11586 - hds:ssh-known-hosts-doc-update, r=weihanglo
add documentation that SSH markers aren't supported ### What does this PR try to resolve? Cargo doesn't support the ``@cert-authority`` or ``@revoked`` markers in SSH Known Hosts files. The lines are silently ignored. If a user is depending on these lines to connect to a Git server via SSH, then their command line Git client will work, but Cargo will fail with an error that the host key doesn't match. This change adds a note explaining that Cargo doesn't support these markers and suggests that the user change their cargo configuration to fetch with the CLI client instead. This PR fixes the first part (of 4) of the suggested tasks to fix #11577. ### How should we test and review this PR? This change only modifies the Cargo book source. Running `mdbook build` and checking the SSH Known Hosts section of the appendix on Git authentication should be sufficient to test the PR. ### Additional information The note in this section repeats what is said in the higher section on SSH authentication, however given the recently implemented host key checking, it seems worth calling out the limitation that Cargo doesn't support these markers in the SSH known hosts file explicitly. Hopefully, it reduces support requests and questions as well.
2 parents 7b4737f + f460ac2 commit 8681a5a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/doc/src/appendix/git-authentication.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ publish their fingerprints on the web; for example GitHub posts theirs at
8181
Cargo comes with the host keys for [github.com](https://github.com) built-in.
8282
If those ever change, you can add the new keys to the config or known_hosts file.
8383

84+
> **Note:** Cargo doesn't support the `@cert-authority` or `@revoked`
85+
> markers in `known_hosts` files. To make use of this functionality, use
86+
> [`net.git-fetch-with-cli`]. This is also a good tip if Cargo's SSH client
87+
> isn't behaving the way you expect it to.
88+
8489
[`credential.helper`]: https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
8590
[`net.git-fetch-with-cli`]: ../reference/config.md#netgit-fetch-with-cli
8691
[`net.ssh.known-hosts`]: ../reference/config.md#netsshknown-hosts

0 commit comments

Comments
 (0)