Certbot Renew --dry-run fails with a 400 message

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: www.87ferrets.ml

I ran this command: sudo certbot renew --dry-run

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/87ferrets.ml.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for 87ferrets.ml
http-01 challenge for www.87ferrets.ml
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (87ferrets.ml) from /etc/letsencrypt/renewal/87ferrets.ml.conf produced an unexpected error: Failed authorization procedure. www.87ferrets.ml (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.87ferrets.ml/.well-known/acme-challenge/lrAXX4T5xVj1qB4ojpvDqid55ovAQhNvuQwRUN_XFlg [81.98.50.63]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>400 Bad Request</title>\n</head><body>\n<h1>Bad Request</h1", 87ferrets.ml (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://87ferrets.ml/.well-known/acme-challenge/qcmmZyNWk1gSp_8bBF20ZsDl3A8966ZVFQxfDhwL5cI [81.98.50.63]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>400 Bad Request</title>\n</head><body>\n<h1>Bad Request</h1". Skipping.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/www.87ferrets.ml.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Cert not due for renewal, but simulating renewal for dry run
Plugins selected: Authenticator apache, Installer apache
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for www.87ferrets.ml
Waiting for verification...
Cleaning up challenges
Attempting to renew cert (www.87ferrets.ml) from /etc/letsencrypt/renewal/www.87ferrets.ml.conf produced an unexpected error: Failed authorization procedure. www.87ferrets.ml (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://www.87ferrets.ml/.well-known/acme-challenge/v26nHnHpIuM5ojzpzw76UXL92EFtHe9NIcFYWDHhbhM [81.98.50.63]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>400 Bad Request</title>\n</head><body>\n<h1>Bad Request</h1". Skipping.
All renewal attempts failed. The following certs could not be renewed:
  /etc/letsencrypt/live/87ferrets.ml/fullchain.pem (failure)
  /etc/letsencrypt/live/www.87ferrets.ml/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/87ferrets.ml/fullchain.pem (failure)
  /etc/letsencrypt/live/www.87ferrets.ml/fullchain.pem (failure)
** DRY RUN: simulating 'certbot renew' close to cert expiry
**          (The test certificates above have not been saved.)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2 renew failure(s), 0 parse failure(s)

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: www.87ferrets.ml
   Type:   unauthorized
   Detail: Invalid response from
   http://www.87ferrets.ml/.well-known/acme-challenge/lrAXX4T5xVj1qB4ojpvDqid55ovAQhNvuQwRUN_XFlg
   [81.98.50.63]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
   2.0//EN\">\n<html><head>\n<title>400 Bad
   Request</title>\n</head><body>\n<h1>Bad Request</h1"

   Domain: 87ferrets.ml
   Type:   unauthorized
   Detail: Invalid response from
   http://87ferrets.ml/.well-known/acme-challenge/qcmmZyNWk1gSp_8bBF20ZsDl3A8966ZVFQxfDhwL5cI
   [81.98.50.63]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
   2.0//EN\">\n<html><head>\n<title>400 Bad
   Request</title>\n</head><body>\n<h1>Bad Request</h1"

   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.
 - The following errors were reported by the server:

   Domain: www.87ferrets.ml
   Type:   unauthorized
   Detail: Invalid response from
   http://www.87ferrets.ml/.well-known/acme-challenge/v26nHnHpIuM5ojzpzw76UXL92EFtHe9NIcFYWDHhbhM
   [81.98.50.63]: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML
   2.0//EN\">\n<html><head>\n<title>400 Bad
   Request</title>\n</head><body>\n<h1>Bad Request</h1"

   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): APACHE2

The operating system my web server runs on is (include version): debian 10 stretch

My hosting provider, if applicable, is: myself

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): no

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

hey: certbot autorenew keeps failing because of a 400. thanks for any help in advance

1 Like

Hi @1234

there

is your answer, read the output. Your port 80 is a https port, not a http port.

Same checking your domain - https://check-your-website.server-daten.de/?q=87ferrets.ml

https://87ferrets.ml:80/ has content. May be a wrong port forwarding or a wrong vHost configuration.

PS: It's a configuration you have created. So you know how to fix it.

--

PPS: There is a new Letsencrypt certificate, created yesterday.

To create that certificate your configuration was ok. So you have created that buggy configuration in the last hours. Undo that.

2 Likes

hey @JuergenAuer thanks for your reply,

do you have any ideas on how i can undo this and create the new certificate?

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