【问题标题】:gitlab-runner x509: certificate signed by unknown authoritygitlab-runner x509:由未知权威签署的证书
【发布时间】:2019-09-01 12:38:24
【问题描述】:

我正在尝试按照以下步骤在 gitlab 上注册一个新的跑步者: https://docs.gitlab.com/runner/register/index.html

但是当我输入 url、token 和标签时。弹出一条错误消息说:

错误:正在注册跑步者...失败跑步者=CS-XXX 状态=无法对https://example.com/api/v4/runners 执行 POST:发布https://example.com/api/v4/runners:x509:证书由未知机构签名

我正在使用新服务器并且已经安装了 gitlab-runner

【问题讨论】:

    标签: openssl certificate gitlab gitlab-ci-runner


    【解决方案1】:

    您需要在注册期间或在跑步者的配置中使用tls-ca-file 选项。

    这里是non-interactive 注册的示例,带有tls-ca-file 选项:

    gitlab-runner register \
          --non-interactive \
          --registration-token YOUTOKEN \
          --url https://example.com/ \
          --tls-ca-file /path/to/your/ca.crt
    

    其他方式,您可以在config.toml[[runners]] 部分下的tls-ca-file 选项中refer tls-ca-file 选项

    更多信息:https://docs.gitlab.com/runner/configuration/tls-self-signed.html

    【讨论】:

    • 我可以为 gitlab runner 和 gitlab 禁用 TLS 吗?我使用外部反向代理来保护 Letsencrypt TLS。同时 runner 通过加密的 docker 网络与 gitlab 通信。仅 http 就足够了。
    猜你喜欢
    • 2018-04-22
    • 2021-02-08
    • 1970-01-01
    • 2016-08-24
    • 2018-07-13
    • 2019-04-12
    • 2021-01-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多