{"record":{"id":"44824c48b7627685","repo":"rust-lang/cargo","slug":"error-found-a-cert-authority-marker-for-host","errorCode":null,"errorMessage":"error: Found a `@cert-authority` marker for `{hostname}`\n\nCargo doesn't support certificate authorities for host key verification. It is\nrecommended that the command line Git client is used instead. This can be achieved\nby setting `net.git-fetch-with-cli` to `true` in the Cargo config.\n\nThe `@cert-authority` line was found in {location}.\n\nSee https://doc.rust-lang.org/stable/cargo/appendix/git-authentication.html#ssh-known-hosts for more information.\n","messagePattern":"error: Found a `@cert-authority` marker for `(.+?)`\n\nCargo doesn't support certificate authorities for host key verification\\. It is\nrecommended that the command line Git client is used instead\\. This can be achieved\nby setting `net\\.git-fetch-with-cli` to `true` in the Cargo config\\.\n\nThe `@cert-authority` line was found in (.+?)\\.\n\nSee https://doc\\.rust-lang\\.org/stable/cargo/appendix/git-authentication\\.html#ssh-known-hosts for more information\\.\n","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sources/git/known_hosts.rs","lineNumber":312,"sourceCode":"            remote_host_key,\n            location,\n        }) => {\n            let key_type_short_name = key_type.short_name();\n            anyhow::bail!(\n                \"error: Key has been revoked for `{hostname}`\\n\\\n                **************************************\\n\\\n                * WARNING: REVOKED HOST KEY DETECTED *\\n\\\n                **************************************\\n\\\n                This may indicate that the key provided by this host has been\\n\\\n                compromised and should not be accepted.\n                \\n\\\n                The host key {key_type_short_name} {remote_host_key} is revoked\\n\\\n                in {location} and has been rejected.\\n\\\n                \"\n            )\n        }\n        Err(KnownHostError::HostHasOnlyCertAuthority { hostname, location }) => {\n            anyhow::bail!(\"error: Found a `@cert-authority` marker for `{hostname}`\\n\\\n                \\n\\\n                Cargo doesn't support certificate authorities for host key verification. It is\\n\\\n                recommended that the command line Git client is used instead. This can be achieved\\n\\\n                by setting `net.git-fetch-with-cli` to `true` in the Cargo config.\\n\\\n                \\n\n                The `@cert-authority` line was found in {location}.\\n\\\n                \\n\\\n                See https://doc.rust-lang.org/stable/cargo/appendix/git-authentication.html#ssh-known-hosts \\\n                for more information.\\n\\\n                \")\n        }\n    }\n}\n\n/// Checks if the given host/host key pair is known.\nfn check_ssh_known_hosts(\n    gctx: &GlobalContext,\n    cert_host_key: &git2::cert::CertHostkey<'_>,","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/rust-lang/cargo/blob/eb98b54bc9f3c74519f43d066cb3fd02ebc88df0/src/sources/git/known_hosts.rs#L294-L330","documentation":"Error \"error: Found a `@cert-authority` marker for `{hostname}`\n\nCargo doesn't support certificate authorities for host key verification. It is\nrecommended that the command line Git client is used instead. This can be achieved\nby setting `net.git-fetch-with-cli` to `true` in the Cargo config.\n\nThe `@cert-authority` line was found in {location}.\n\nSee https://doc.rust-lang.org/stable/cargo/appendix/git-authentication.html#ssh-known-hosts for more information.\n\" thrown in rust-lang/cargo.","triggerScenarios":"Thrown at src/sources/git/known_hosts.rs:312 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb98b54bc9f3c74519f43d066cb3fd02ebc88df0","analyzedAt":"2026-08-11T17:42:36.556Z","contentChangedAt":"2026-08-11T17:42:36.556Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}