Closed peixotorms closed 1 year ago
Hi @peixotorms
The force https rewrite rules will only be applied when you add a -f
, -F
, or --force-https
option with the vhsetup.sh script.
Thanks for the tip, but my site's cert renewal seems to be working fine with HTTPS redirect. Did you hit any cert renewal issues?
https://letsencrypt.org/docs/challenge-types/
With HTTP-01 challenge it calls http://
If you are renewing certificates automatically, when the certificate is due, it will send an http request. If you have http to https globally, without the exclusion (ie when you set this on cloudflare for example), it fails to renew the certificates.
I have experienced this on hundreds of sites, as I am a developer. The only option to allow it to renew, is to remove the redirect for that endpoint.
From letsencrypt:
Our implementation of the HTTP-01 challenge follows redirects, up to 10 redirects deep. It only accepts redirects to “http:” or “https:”, and only to ports 80 or 443. It does not accept redirects to IP addresses. When redirected to an HTTPS URL, it does not validate certificates (since this challenge is intended to bootstrap valid certificates, it may encounter self-signed or expired certificates along the way).
The HTTP-01 challenge can only be done on port 80. Allowing clients to specify arbitrary ports would make the challenge less secure, and so it is not allowed by the ACME standard.
So, it will follow the redirects to https as well, but the challenge can only be done on port 80 hence I had this fail, I think on all cases.
You can run the script to install the domain, but 2 months later when you try to renew, it's failing at least for all of my client sites.
@Code-Egg I see you marked as complete. Did you implement this, or simply closed it? Thank you
Hi @peixotorms,
I tried to launch a site LE and force the HTTPS rule applied, and then tried the dry run to renew the cert and it works, that's why I closed it.
Now, I'm checking the OLS release log, it seems the skip rewrite processing for LE verification req has been a built-in feature since 1.6.6, that's why I did not hit this issue.
Hi,
When installing with letsencrypt, the scripts adds this to .htaccess:
This will prevent letsencrypt from renewing the certificates, as it needs to validate it via http (by default). Instead, you should use:
Also, maybe instead of editing the htaccess, it could go under Virtual Host > Rewrite