Self-signed certificate does not work with gitlab-runner

The operating system is CentOS 7: When executing gitlab-runner register an error occurs because the ssl certificate can not be veryfied (because it is self-signed).

I found a guide about what to do: https://gitlab.com/gitlab-org/gitlab-runner/blob/master/docs/configuration/tls-self-signed.md

  1. solution didn’t work. I tired the .pem and the .crt file but both failed.
  2. solution didn’t work: CentOS is a *nix system and the program runs as root
  3. solution didn’t work either I tried both the .pem and .crt file

The error message always says:

ERROR: Registering runner... failed                 runner=U9q7G5Mz status=couldn't execute POST against https://192.168.1.105/api/v4/runners: Post https://192.168.1.105/api/v4/runners: x509: cannot validate certificate for 192.168.1.105 because it doesn't contain any IP SANs
PANIC: Failed to register this runner. Perhaps you are having network problems

I would appreciate any help!

Have a look here, I guess you’re using an IP instead of a hostname!?

2 Likes