AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 1077239
Accepted
NBajanca
NBajanca
Asked: 2021-09-11 14:30:08 +0800 CST2021-09-11 14:30:08 +0800 CST 2021-09-11 14:30:08 +0800 CST

带有 CA 签名证书的 GitLab 服务器的 GitLab Runner 失败:证书链中的自签名证书

  • 772

我的公司更改了证书颁发机构(它是一个单一的 CA,现在我们有一个根 CA 和一个中间 CA)。我成功更改了 GitLab 实例中的配置并移至运行器(即在 Ubuntu 18.04.5 LTS 上)。我试图遵循GitLab 文档但没有成功。

我遵循此处的默认方法,即“默认 - 读取系统证书”,因此我将证书(CA 和中级)添加到 Ubuntu CA 列表中。一切似乎都奏效了,因为跑步者出现在 GitLab 中。

我开始工作,我得到:

Running with gitlab-runner 11.5.0 (3afdaba6)
  on RUN01 12ccbb74
Using Docker executor with image node:latest ...
Pulling docker image node:latest ...
Using docker image sha256:ab773999a02271b25a9f3bce46018fc3ad46a7f922a5e3e8712b6d1c7087c415 for node:latest ...
Running on runner-12ccbb74-project-73-concurrent-0 via (...)...
00:02
Fetching changes...
00:01
HEAD is now at 60b6860 Update dependency mocha to v9
fatal: unable to access 'https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@(...).git/': SSL certificate problem: unable to get issuer certificate
ERROR: Job failed: exit code 1

然后我(在 GitLab 实例上)将完整链添加到证书文件中,错误更改为SSL certificate problem: self signed certificate in certificate chain.

我的逻辑*:它适用于 Ubuntu,但不适用于 Docker。所以我转到了Docker 和 Kubernetes 执行程序的信任 TLS 证书部分。

到目前为止我已经尝试过,但没有成功:

  1. 我将根 CA 证书添加到/etc/gitlab-runner/certs/ca.crt.
  2. 我还尝试使用链中包含根 CA 和中间 CA 的文件。
  3. 我添加volumes = ["/cache", "/path/to-ca-cert-dir/ca.crt:/etc/gitlab-runner/certs/ca.crt:ro"]到config.toml文件中。但我几乎可以肯定我应该/path/to-ca-cert-dir用一些东西代替。我只是不知道是什么。

*更新:当我安装 GitLab Runner 时,我使用 Debian/Ubuntu/CentOS/RedHat 的 GitLab 存储库安装,因此 Docker/K8s 说明没有意义。我发布了有关如何解决此问题的答案。

ubuntu ssl-certificate docker gitlab
  • 1 1 个回答
  • 4352 Views

1 个回答

  • Voted
  1. Best Answer
    NBajanca
    2021-09-11T16:35:33+08:002021-09-11T16:35:33+08:00

    我能够按照Supported options for self-signed certificate targets the GitLab server中的第三个选项使其工作,即:

    读取 PEM 证书:GitLab Runner 从预定义文件中读取 PEM 证书(不支持 DER 格式):

    当 GitLab Runner 以 root 身份执行时,*nix 系统上的 /etc/gitlab-runner/certs/hostname.crt。

    如果您的服务器地址是https://my.gitlab.server.com:8443/,请在以下位置创建证书文件:/etc/gitlab-runner/certs/my.gitlab.server.com.crt。

    所以我只是将完整的链(GitLab 证书、中级、根)添加到文件名/etc/gitlab-runner/certs/<gitlab-url>.crt中。重新启动服务gitlab-runner restart并且工作正在运行。

    • 1

相关问题

  • 无法通过 Ubuntu VPN 访问外部网络

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

  • VirtualBox 上 Ubuntu 的访客优化技巧 [关闭]

  • 外部硬盘上的 virtualbox 虚拟硬盘驱动器(Vista 主机上的 ubuntu 客户机)

  • 如何在 Ubuntu 上挂载 LVM 分区?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve