# SSL certificates

> How WP Waterfall gets and renews the SSL certificate for your site, what Cloudflare does in front of it, and what happens if a renewal fails.

Source: https://docs.wpwaterfall.com/ssl-certificates

Every WP Waterfall site serves HTTPS, and you never upload a certificate or manage a key. This article is the one place that explains how certificates are issued and renewed. To add a domain and set its records, see [Domains](https://docs.wpwaterfall.com/domains).

## How does it work?

There are two certificates on the road from a visitor to your site.

- **Cloudflare's certificate** is what visitors see. Cloudflare sits in front of your site and issues it for each domain once the domain's records resolve. It validates the domain over HTTP, or by a TXT record for a wildcard and for a domain on WP Waterfall DNS. Leave your CNAME as DNS only, so nothing redirects `/.well-known/acme-challenge/` to HTTPS while Cloudflare issues the certificate.
- **The server's certificate** is what Cloudflare checks when it connects to WP Waterfall's web server. It comes from Let's Encrypt, and WP Waterfall installs it. That is why Cloudflare's SSL mode can stay at Full (strict).

For the server's certificate, Let's Encrypt must see a record at `_acme-challenge.<your domain>`. On WP Waterfall DNS, WP Waterfall writes it in the zone. At any other DNS host, your own Cloudflare account included, you add one CNAME there that points at `<your site id>.acme.sites.wpwaterfall.dev`. It lets WP Waterfall prove the domain to Let's Encrypt without access to your DNS, and WP Waterfall never asks for your registrar password or a DNS token. Keep the record in place, because renewals use it. Moving the site to another server does not change it.

- WP Waterfall renews each certificate when less than 30 days remain. Renewals run once a day, at a time that differs from site to site, so they do not all happen at once.
- A renewal installs the new certificate only after the web server accepts its settings. If the test fails, the old certificate stays in place.
- The temporary domain of every environment uses a platform certificate for `*.wpwaterfall.dev`, served by Cloudflare. See [Your site's temporary domain](https://docs.wpwaterfall.com/temporary-domain).

## SSL fixes itself

You never have to press a button for SSL. Every 10 minutes WP Waterfall checks each connected domain. If a certificate is pending, still securing, rejected, or ends within 30 days, or Cloudflare has not verified the hostname, WP Waterfall runs the same repair as the Refresh SSL menu item. It writes missing validation records, asks Cloudflare again, and orders the server certificate again.

- The wait between tries starts at 10 minutes and doubles up to 6 hours. Your current certificate keeps working while WP Waterfall retries.
- Refresh SSL is still there if you want to start the repair now. It does the same thing and is never required.
- WP Waterfall removes or replaces only the DNS records it wrote itself. A record you made stays, even if it blocks the certificate. The domain's status text then says which record WP Waterfall left alone, and SSL fixes itself soon after you remove or change it.
- If your DNS is outside Cloudflare and Cloudflare asks for a TXT record, the domain's status text names the exact record to add at your DNS provider.
- After 8 tries in 72 hours that do not work, WP Waterfall stops and tells its own staff. Nothing is asked of you.
- A certificate you installed yourself is yours. WP Waterfall does not renew or replace it. See [Custom SSL](https://docs.wpwaterfall.com/custom-ssl).

## Related

- [Domains](https://docs.wpwaterfall.com/domains)
- [Custom SSL](https://docs.wpwaterfall.com/custom-ssl)
- [Cloudflare 520 to 526 errors](https://docs.wpwaterfall.com/troubleshooting-cloudflare-52x)
