好的,我一步一步地跟着这篇文章http://moonlightbox.logdown.com/posts/2016/09/12/gitlab-ci-runner-register-x509-error然后它就像一个魅力。为防止死链接,我复制以下步骤:
首先在 GitLab 服务器(不是运行器)上编辑 ssl 配置
vim /etc/pki/tls/openssl.cnf
[ v3_ca ]
subjectAltName=IP:192.168.1.1 <---- Add this line. 192.168.1.1 is your GitLab server IP.
重新生成自签名证书
cd /etc/gitlab/ssl
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/gitlab/ssl/192.168.1.1.key -out /etc/gitlab/ssl/192.168.1.1.crt
sudo openssl dhparam -out /etc/gitlab/ssl/dhparam.pem 2048
sudo gitlab-ctl restart
将新 CA 复制到 GitLab CI 运行器
scp /etc/gitlab/ssl/192.168.1.1.crt root@192.168.1.2:/etc/gitlab-runner/certs
谢谢@Moon Light @Wassim Dhif