gitlab-ci-multi-runner register

给我

couldn't execute POST against https://xxxx/ci/api/v1/runners/register.json:
Post https://xxxx/ci/api/v1/runners/register.json: 
x509: cannot validate certificate for xxxx because it doesn't contain any IP SANs

有没有办法禁用认证验证?

我使用的是Gitlab 8.13.1和Gitlab ci multi runner 1.11.2.

推荐答案

根据Wassim的答案和gitlab documentation about tls-self-signed and custom CA-signed certificates,如果您不是GitLab服务器的管理员,而只是拥有Runner的服务器的管理员(如果Runner是以root身份运行的),那么这里就是为了节省一些时间:

SERVER=gitlab.example.com
PORT=443
CERTIFICATE=/etc/gitlab-runner/certs/${SERVER}.crt

# Create the certificates hierarchy expected by gitlab
sudo mkdir -p $(dirname "$CERTIFICATE")

# Get the certificate in PEM format and store it
openssl s_client -connect ${SERVER}:${PORT} -showcerts </dev/null 2>/dev/null | sed -e '/-----BEGIN/,/-----END/!d' | sudo tee "$CERTIFICATE" >/dev/null

# Register your runner
gitlab-runner register --tls-ca-file="$CERTIFICATE" [your other options]

Update 1: CERTIFICATE必须是证书文件的绝对路径.

Update 2:如果自定义CA因gitlab-runner bug #2675而签名,则可能仍会失败

Go相关问答推荐

无法找到与golang、nginx和postquist进行的docker-compose./主要

运行add. inf,这样我们就可以在app.conf中使用. inf参数了?

减少在围棋中映射DTO时的重复代码量

租户GUID X的租户不存在self 邮箱帐户的租户(我是唯一的成员)

使用Digitorus/pdfsign在GO(Golang)中签署pdf文件

为什么 Go 对于长度为 100k 的切片使用的内存比长度为 100k 的数组要少?

如何获取集群外go Kubernetes客户端的当前命名空间?

Golang Fiber Render - 将数据发送到多个布局

这种合并排序的实现有什么问题?

在 Go 中解组编号的 XML 标签

如何将任何类型的数据值传递到 Golang 中的 GRPC Protobuf struct ?

Go 中的 Azure JWT 验证不起作用

使用 Go 根据 /etc/shadow 文件中的散列密码验证密码

golang yaml 马歇尔网址

不能使用 mockDB(*MockDB 类型的变量)作为 struct 文字中的 *gorm.DB 值

Golang:如何判断通过缓冲通道进行通信时生产者或消费者是否较慢?

使用无服务器工作流 go sdk 时出现间歇性 JSON 解组错误

如何在 Windows 上使用 cgo 为 386 arch 构建 lib?

退格字符在围棋操场中不起作用

即使没有竞争条件也没有得到任何输出