{"record":{"id":"913f5d094482ae89","repo":"rust-lang/cargo","slug":"error-key-has-been-revoked-for-hostname","errorCode":null,"errorMessage":"error: Key has been revoked for `{hostname}`\n**************************************\n* WARNING: REVOKED HOST KEY DETECTED *\n**************************************\nThis may indicate that the key provided by this host has been compromised and should not be accepted.\n\nThe host key {key_type_short_name} {remote_host_key} is revoked\nin {location} and has been rejected.\n","messagePattern":"error: Key has been revoked for `(.+?)`\n\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\n\\* WARNING: REVOKED HOST KEY DETECTED \\*\n\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\nThis may indicate that the key provided by this host has been compromised and should not be accepted\\.\n\nThe host key (.+?) (.+?) is revoked\nin (.+?) and has been rejected\\.\n","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/sources/git/known_hosts.rs","lineNumber":298,"sourceCode":"                resolve this error by {old_key_resolution}\\n\\\n                \\n\\\n                The key provided by the remote host is:\\n\\\n                \\n\\\n                {hostname} {key_type_name} {remote_host_key}\\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        Err(KnownHostError::HostKeyRevoked {\n            hostname,\n            key_type,\n            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\\","sourceCodeStart":280,"sourceCodeEnd":316,"githubUrl":"https://github.com/rust-lang/cargo/blob/eb98b54bc9f3c74519f43d066cb3fd02ebc88df0/src/sources/git/known_hosts.rs#L280-L316","documentation":"Error \"error: Key has been revoked for `{hostname}`\n**************************************\n* WARNING: REVOKED HOST KEY DETECTED *\n**************************************\nThis may indicate that the key provided by this host has been compromised and should not be accepted.\n\nThe host key {key_type_short_name} {remote_host_key} is revoked\nin {location} and has been rejected.\n\" thrown in rust-lang/cargo.","triggerScenarios":"Thrown at src/sources/git/known_hosts.rs:298 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"}