How to Renew AutoSSL Certificates being redirected by Cloudflare's HTTPS Redirection
Introduction
There is a common issue of renewing AutoSSL Certificates while using Cloudflare for the domain.
"Local HTTP DCV error (domain.com): The content "<html> <head><title>301
Moved Permanently</title></head> <body> <center><h1>301 Moved Permanently
</h1></center> <hr><center> …" of the DCV (Domain Control Validation) file,
as accessed at
"https://domain.com/.well-known/pki-validation/69B2BC6319C8DE110EC2596BFCA07878.txt"
and redirected from
"http://domain.com/.well-known/pki-validation/69B2BC6319C8DE110EC2596BFCA07878.txt",
did not match the expected value."
Procedure
To resolve this error, you would need to disable "Always Use HTTPS" in Cloudflare. This option is in the Edge Certificates tab of the Cloudflare SSL/TLS tab. Once disabled, you can then renew your certificate. After you have replaced the SSL certificate, you may re-enable the option if you wish.
You can find more on Cloudflare's HTTPS Redirection here:
https://support.cloudflare.com/hc/en-us/articles/204144518#h_a61bfdef-08dd-40f8-8888-7edd8e40d156
Additionally, you can also install SSL certificates via Let's Encrypt as Let's Encrypt allows for redirections. More on installing Let's Encrypt can be found here:
https://docs.cpanel.net/knowledge-base/third-party/the-lets-encrypt-plugin/86/
PER BYPASSARE AUTODISCOVER:
https://wiki/index.php?action=faq&cat=29&id=1020&artlang=it&highlight=autossl