Gitlab:对等方的证书颁发者已被标记为用户不信任

问题描述 投票:0回答:2

我有一个本地 gitlab,我正在尝试运行一些构建/管道,但出现以下错误 -

fatal: unable to access 'https://gitlab-ci-token:[MASKED]@gitlab.systems/testing/test-project-poc.git/': Peer's certificate issuer has been marked as not trusted by the user.

我已经研究过这个 - Gitlab:无法识别对等证书颁发者,并按照通过合并

.pem
server certificate
intermediate certificate
来获取
root certificate
文件的步骤,但我仍然得到以下内容错误并且真的很难找到根本原因。

/etc/gitlab/gitlab.rb config

##! enable/disable 2-way SSL client authentication
#nginx['ssl_verify_client'] = "off"

##! if ssl_verify_client on, verification depth in the client certificates chain
#nginx['ssl_verify_depth'] = "1"

nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.systems.pem"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.systems.key"

还有其他配置需要更新/修改吗?非常感谢任何指导。

gitlab gitlab-ci-runner gitlab-omnibus
2个回答
6
投票

我猜您正在使用自签名证书。如果是这种情况,您有两种选择来纠正此问题:

  1. 推荐选项:这里我再次假设您已经解决了 gitlab-runner 和 gitlab 本身之间的问题,因此您成功注册了 runner。所以你已经在 /etc/gitlab-runner/certs 中拥有了证书文件。因此,在托管 gitlab-runner 的服务器上,运行以下命令:

    git config --system http.sslCAInfo /etc/gitlab-runner/certs/CERITIFICATE_NAME.crt
  2. 这是不安全的:这里你只需禁用 git https 证书验证即可:

    git config --system http.sslverify false

0
投票

我的 /etc/gitlab-runner/certs/blablabl.cer 必须按照 https://docs.gitlab.com/runner/configuration/tls-self-signed.html 拥有完整的链/根 - 这是有点奇怪,因为生产服务器有较小的服务器并且可以工作。重新启动跑步者。

© www.soinside.com 2019 - 2024. All rights reserved.