Skip to content

Fix for hanging "http-01 challenge for ..." due to https auto-redirects

Malte Lau Petersen requested to merge maltelau/gitlab-ssl-renew:master into master

When you enable "Force domains with SSL certificates to use HTTPS" in your gitlab Pages settings, gitlab-auth-hook.sh will hang waiting for it to think the CI/CD pipeline is finished. This is because gitlab redirects with a "301 Permanently Moved" when the setting is on.

Steps to reproduce: Run the script on a gitlab page with the above setting turned on.

Proposed solution: give curl the -L flag to tell it to follow redirects, and tell awk to give us the last http status code curl returned.

Caveat: I don't know if certbot also follows http redirects

Also in this patch is a commit which includes the token in the commit message like I think was originally intended.

Merge request reports