【发布时间】:2019-07-04 09:26:56
【问题描述】:
运行 GitLab CI Runner 时我必须指定
环境 = ["GIT_SSL_NO_VERIFY=true"]"
如果没有它,我会从 GitLab CI 收到以下错误
Cloning into 'D:/GitRunner/builds/c2RN8y5j/0/joeybob/mytestproect'...
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@myserver.local/joeybob/mytestproect.git/': error setting certificate verify locations:
CAfile: D:\GitRunner\builds\c2RN8y5j\0\joeybob\mytestproect.tmp\CI_SERVER_TLS_CA_FILE
CApath: none
检查 CI_SERVER_TLS_CA_FILE 的内容,我可以看到它与 BEGIN CERTIFICATE 和 END CERTIFICATE 之间的预期值匹配。
当我包含 GIT_SSL_NO_VERIFY=true 时,CI 窗口会产生以下错误但仍然成功
WARNING: Failed to load system CertPool: crypto/x509: system root pool is not available on Windows
ERROR: Failed to parse PEM in D:\GitRunner\builds\c2RN8y5j\0\joeybob\mytestproect.tmp\CI_SERVER_TLS_CA_FILE
我认为 PEM (crt) 文件有问题。我在 Windows Server 2016 上运行它,并以 base-64 编码的 X.509 格式从本地受信任的根证书存储中导出了证书。这个问题可能与 windows 对文件的编码方式有关吗?
【问题讨论】:
-
我意识到 builds 文件夹中的 pem 文件正在以混合行结尾复制到那里.....当我保存带有 windows 结尾的 pem 文件时也会发生这种情况。我还不知道如何防止这种情况发生
-
@Micromegas 抱歉,不,我最终不得不盲目相信证书,这既不是安全的,也不是我想做的:(
标签: git ssl gitlab gitlab-ci-runner