19

I'm trying to register a new runner on gitlab following these steps : https://docs.gitlab.com/runner/register/index.html

But when I enter the url, token and tags, an error message pops-up saying:

ERROR: Registering runner... failed runner=CS-XXX status=couldn't execute POST against https://example.com/api/v4/runners: Post https://example.com/api/v4/runners: x509: certificate signed by unknown authority

I'm working on a new server and already installed the gitlab-runner.

DevThiman
  • 920
  • 1
  • 9
  • 24
Abhishek Rane
  • 202
  • 1
  • 3
  • 8

1 Answers1

20

you need to use tls-ca-file option during registration or in the configuration of your runner.

Here is an example of non-interactive registration with tls-ca-file option :

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

Other way, you can refer the tls-ca-file option in your config.toml under the [[runners]] section

more info : https://docs.gitlab.com/runner/configuration/tls-self-signed.html

Nicolas Pepinster
  • 5,413
  • 2
  • 30
  • 48
  • 5
    Can I disable TLS for gitlab runner and gitlab ? I use external reverse-proxy to secure Letsencrypt TLS. Meanwhile runner communicates to gitlab through encrypted docker network. http-only is more than enough. – Vinigas Sep 05 '21 at 07:08