Skip to content

Instantly share code, notes, and snippets.

@abelardojarab
Created December 22, 2021 00:15
Show Gist options
  • Save abelardojarab/e954df52c80dcddcb8c70c3471f17548 to your computer and use it in GitHub Desktop.
Save abelardojarab/e954df52c80dcddcb8c70c3471f17548 to your computer and use it in GitHub Desktop.
Add the certificate of server
SERVER=jaraberrocal.readmyblog.org
PORT=2443
CERTIFICATE=/etc/gitlab-runner/certs/${SERVER}.crt
# Create the certificates hierarchy expected by gitlab
sudo mkdir -p $(dirname "$CERTIFICATE")
# Get the certificate in PEM format and store it
openssl s_client -connect ${SERVER}:${PORT} -showcerts </dev/null 2>/dev/null | sed -e '/-----BEGIN/,/-----END/!d' | sudo tee "$CERTIFICATE" >/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment