Can't renew cert behind Cloudflare. (LEMP + LetsEncrypt + Cloudflare)

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: frankpanduh.com

I ran this command: cerbot renew --dry-run

It produced this output:


Processing /etc/letsencrypt/renewal/frankpanduh.com.conf


Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator nginx, Installer nginx
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for frankpanduh.com
Waiting for verification…
Cleaning up challenges
Attempting to renew cert (frankpanduh.com) from /etc/letsencrypt/renewal/frankpanduh.com.conf produced an unexpected error: Failed authorization procedure. frankpanduh.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://frankpanduh.com/ [2606:4700:30::681b:be3f]: "<html lang=“en-US” class=“boxed”><meta charset=“UTF-8”><meta name=“viewport” content=“width=device-width, i”. Skipping.
All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/frankpanduh.com/fullchain.pem (failure)


** DRY RUN: simulating ‘certbot renew’ close to cert expiry
** (The test certificates below have not been saved.)

All renewal attempts failed. The following certs could not be renewed:
/etc/letsencrypt/live/frankpanduh.com/fullchain.pem (failure)
** DRY RUN: simulating ‘certbot renew’ close to cert expiry
** (The test certificates above have not been saved.)


1 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:

  • The following errors were reported by the server:

    Domain: frankpanduh.com
    Type: unauthorized
    Detail: Invalid response from https://frankpanduh.com/
    [2606:4700:30::681b:be3f]: "<html lang=“en-US”
    class=“boxed”><meta charset=“UTF-8”><meta
    name=“viewport” content=“width=device-width, i”

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A/AAAA record(s) for that domain
    contain(s) the right IP address.

My web server is (include version): nginx version: nginx/1.14.0 (Ubuntu)

The operating system my web server runs on is (include version): Ubuntu 18.04

My hosting provider, if applicable, is: digitalocean.com (droplet) + CloudFlare (cdn)

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): nope

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): certbot 0.31.0

Do i just revert back to digitalocean nameserver for each renewal?

You’re probably hitting this bug.

tl;dr; Set Cloudflare’s SSL mode to “Flexible” or use Certbot with --webroot rather than --nginx.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.