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

问题描述

我有一个本地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:Peer's Certificate issuer is not recognized,并遵循通过合并.pemserver certificateintermediate 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"

我是否需要更新/修改其他配置?任何指导都非常感激。

解决方法

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

  1. 推荐选项:在这里,我再次假设您已经解决了gitlab-runner和gitlab itseld之间的问题,因此您成功注册了运行器。因此,您已经在/ 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