【问题标题】:Artifactory jfrog cli unable to authenticateArtifactory jfrog cli无法进行身份验证
【发布时间】:2019-06-26 02:51:20
【问题描述】:

当我收到此错误时,尝试使用 jfrog cli 与人工服务器集成

jfrog rt config example-company --url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS
[Info] Encrypting password...
[Error] Get https://artifactory.example.com/api/security/encryptedPassword: x509: certificate signed by unknown authority

在浏览器中导航到 https://artifactory.example.com/api/security/encryptedPassword 显示 TLS 证书有效,但是我得到一个不同的错误:

{
  "errors": [
    {
      "status": 404,
      "message": "User not found: bill.gates"
    }
  ]
}

ping 命令也会返回 TLS 错误

jfrog rt ping --url=https://artifactory.example.com
[Error] Get https://artifactory.example.com/artifactory/api/system/ping: x509: certificate signed by unknown authority

jfrog cli 是用 golang 编写的。运行版本:

go version
go version go1.12.5 darwin/amd64

查看jfrog github问题,其他人也报告了类似问题

https://github.com/jfrog/jfrog-cli/issues/277

如何让 jfrog cli 连接到 artifactory 服务器?

【问题讨论】:

    标签: ssl go artifactory


    【解决方案1】:

    错误是由错误配置的 apache vhost 引起的。由于证书链捆绑在证书中,因此不需要 SSLCertificateChainFile。 Web 浏览器处理这种错误配置没有问题,但 golang 更注重链。

    错误的配置

      SSLCertificateFile      "/etc/ssl/certs/artifactory.example.com.crt.pem"
      SSLCertificateKeyFile   "/etc/ssl/private/artifactory.example.com.key.pem"
      SSLCertificateChainFile "/etc/ssl/certs/STAR.bad.example.com.pem"
    

    工作配置

      SSLCertificateFile      "/etc/ssl/certs/artifactory.example.com.crt.pem"
      SSLCertificateKeyFile   "/etc/ssl/private/artifactory.example.com.key.pem"
    

    【讨论】:

      猜你喜欢
      • 2014-06-06
      • 1970-01-01
      • 2016-01-11
      • 1970-01-01
      • 1970-01-01
      • 2013-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多