Based on Wassim's answer and gitlab documentation on self-signed and CA-signed certificates here, to save time if you are not a gitlab server administrator, but just a server with runners (and if the runner runs as root):
SERVER=gitlab.example.com
PORT=443
CERTIFICATE=/etc/gitlab-runner/certs/${SERVER}.crt
sudo mkdir -p $(dirname "$CERTIFICATE")
openssl s_client -connect ${SERVER}:${PORT} -showcerts </dev/null 2>/dev/null | sed -e '/-----BEGIN/,/-----END/!d' | sudo tee "$CERTIFICATE" >/dev/null
gitlab-runner register --tls-ca-file="$CERTIFICATE" [your other options]
Update 1: The certificate must be an absolute path in the right place.
2: CA - gitlab-runner # 2675