将 Eclipse JGit 连接到 GitHub,以便 TeamCity 可以检查更改

Connecting Eclipse JGit to GitHub, so TeamCity may check for changes

GitHub 已经启用了它的 2nd phase of SSH protocol security,在那里他们禁止使用带有 RSA 密钥的 SHA-1。 OpenSSH 客户端使用 RSA 密钥工作正常,但 TeamCity 中的 org.jgit 客户端不再工作,得到:

Failed to collect changes, error: org.eclipse.jgit.errors.NoRemoteRepositoryException: git@github.com:Project/Repository.git: ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type.

我如何指示 TeamCity 不使用 SHA-1 而是使用受支持的散列?

我可以迁移到 Ed25519 密钥,但我们的 Windows 代理不支持它,我必须再次更改 TeamCity 中的所有密钥,这意味着我将遇到两个问题。

2022 年 GitHub 的 SSH RSA 密钥是否有实用的方法让 TeamCity 成为朋友?作为参考,我在 2021.2.1.

TeamCity 现在有可以使用 SHA-512 正确处理 RSA 密钥的版本,GitHub 会接受。与大多数其他客户端不同,TeamCity 的旧版本更喜欢 ssh-rsa 而不是 rsa-sha2-512rsa-sha2-256,因此他们在使用 RSA 时将始终尝试使用不安全的基于 SHA-1 的 RSA 签名登录键并获取此消息。 OpenSSH 优先选择基于 SHA-2 的签名,因此它有效。

如果您使用的是最新版本 2021.2.3 或更高版本,那么您应该可以毫无问题地使用 RSA 密钥。 Ed25519 密钥或 ECDSA 密钥也可以正常工作,尽管旧版本也可能存在错误。