• Need professional Virtualmin server support? Contact us for a quote.

The client lacks sufficient authorization whilst renewing a Let’s Encrypt certificate on a Virtualmin server

On a Virtualmin server, refreshing a Let’s Encrypt certificate gives the following error:

Requesting a certificate for domain.com from Let's Encrypt ..
.. request failed : Web-based validation failed :

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Cert is due for renewal, auto-renewing...
Renewing an existing certificate
Performing the following challenges:
http-01 challenge for domain.com
Using the webroot path /home/domain.com/public_html for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. domain.com (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://domain.com/.well-known/acme-challenge/A3oiNXYoxM6Bwze9iTWC0KoxCf-JzF49ozlwJpVzucc [52.215.112.96]: "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-w"
IMPORTANT NOTES:
- The following errors were reported by the server:

Domain: domain.com
Type: unauthorized
Detail: Invalid response from
http://domain.com/.well-known/acme-challenge/A3oiNXYoxM6Bwze9iTWC0KoxCf-JzF49ozlwJpVzucc
[52.215.112.96]: "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n
<meta charset=\"utf-8\">\n <meta name=\"viewport\"
content=\"width=device-w"

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 error was because the NGINX file had directives that wouldn’t let Let’s Encrypt complete. We had to refresh the NGINX configuration but Edit Virtual Server, remove NGINX and SSL NGINX and then re-add.

It was a Laravel website, so I also had to add both:

index index.html index.php

and

location / {
   try_files $uri $uri/ /index.php?$query_string;
}

to get the site running.

I believe the location parameter broke the well known location. This error is hard to troubleshoot, see multiple references all with different answers below:

References:
https://www.virtualmin.com/node/58287
https://www.virtualmin.com/node/56388
https://laravel.com/docs/deployment#nginx

Share this article

Share on facebook
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top