问题
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. A 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
回答1:
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
来源:https://stackoverflow.com/questions/55622960/gitlab-runner-x509-certificate-signed-by-unknown-authority