I work on many side projects and try to set up https for each one. Since I can't afford to pay for certs, I use Letsencrypt. I also use Cloudflare in case I get traffic spikes. I start with getting an SSL cert with Letsencrypt, then put Cloudflare in front of it.
Problem is, when time comes to renew the Letsencrypt cert, I have to turn off Cloudflare in order to do so every time because the IP it sees is now different (Cloudflare's IP instead of my server's IP).
I know Cloudflare provides SSL for free and as long as it has a https connection to my server, it's fine, so technically I don't even have to update my SSL cert at all. But I'd like to keep my server's SSL cert updated so I have the flexibility to turn off Cloudflare at any time and still be up and have a valid cert.
Am I doing something wrong in my process? Is there an option I can use in letsencrypt renew to handle this better, instead of having to log in to Cloudflare to turn it off, wait a few mins, run renew, then turn Cloudflare back on again, every 2 months?
[edit] Getting downvoted for some reasons, maybe because I didn't include my error msg with my setup. Here it is.
-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/[mydomain].com.conf
-------------------------------------------------------------------------------
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
tls-sni-01 challenge for [mydomain].com
Waiting for verification...
Cleaning up challenges
Attempting to renew cert from /etc/letsencrypt/renewal/[mydomain].com.conf produced an unexpected error: Failed authorization procedure. [mydomain].com (tls-sni-01): urn:acme:error:tls :: The server experienced a TLS error during domain verification :: Failed to connect to 104.18.55.209:443 for tls-sni-01 challenge. Skipping.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: [mydomain].com
Type: tls
Detail: Failed to connect to 104.18.55.209:443 for tls-sni-01
challenge
Obviously, 104.18.55.209 is a Cloudflare IP. It's not able to connect to it for the challenge.
[edit 2] Tim said to give the CloudFlare Page rules and my domain. My domain is memechicken.com, and my CF Page Rules is just empty. Everything is default setup pretty much. And finally here are my Crypto tab settings that should be relevant:
Everything is default. I didn't change anything.