ssl - Artifactory jfrog cli无法进行身份验证
问题描述
当我收到此错误时,尝试使用 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 服务器?
解决方案
这些错误是由错误配置的 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"
推荐阅读
- forms - 根据 Google 表单提交发送日历邀请
- python - 从函数中获取 Kruskal-Wallis 等级
- django - 无法使用 UserCreationForm 提交表单
- android - Delphi,围绕 Google Play Console 的“为平板电脑设计应用程序”优化技巧工作
- pycuda - Pycuda:cuTexRefSetArray 失败:尚未启用对等访问
- php - 如何防止当前用户两次执行功能?
- python - 405 响应使用烧瓶服务器的 POST 请求
- google-apps-script - 函数 setFaviconUrl() 不添加 favicon - 为什么?
- hashicorp-vault - 保险柜策略是分层的吗?
- php - PHP MySQL LIKE 查询和标点符号