繁体   English   中英

Spring Cloud 配置服务器使用 SSH 密钥访问 GIT 存储库提供身份验证是必需的,但尚未注册 CredentialsProvider

[英]Spring cloud config server accessing GIT repository using SSH key giving Authentication is required but no CredentialsProvider has been registered

我正在尝试设置 Spring 云配置服务器,并想使用 SSH 密钥访问 GIT 存储库。 我已经使用ssh-keygen -m PEM -t rsa -b 4096 -C "PIQ-Config"命令创建了 SSH 公钥和私钥,并在 GIT SSH 公钥上添加了密钥。

GIT 存储库上的 SSH 密钥配置

我可以使用 ssh git clone 命令从命令行进行 git clone。

以下是STS中的配置

server:
        git:
          uri: https://visualstudio.com/p2020/_git/myrepo
          ignoreLocalSshSettings: true
          hostKey: mypublickey
          hostKeyAlgorithm: ssh-rsa
          privateKey: |
                      -----BEGIN RSA PRIVATE KEY-----
                      -----END RSA PRIVATE KEY-----
                  

我的服务器正常启动,没有任何错误。 但是当我试图点击控制台上的 URL 时,它给出了以下错误

引起:org.eclipse.jgit.errors.TransportException: Authentication is required but no CredentialsProvider has been registered

请帮我解决这个问题。

您使用的是 https 而不是 ssh,因此您需要用户名和密码身份验证而不是私钥

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM