Lets Encrypt SSL Error: The client lacks sufficient authorization 403 Forbidden

January 07, 2018

Problem

You might encounter below error: ``` Failed authorization procedure. example.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://example.com/.well-known/acme-challenge/jTcgYGTDkvxnX0ocm9NKrJyyM0rAgwwflurdfUURH_Q: " 403 Forbidden

Forbidden

403 Forbidden

Forbidden

IMPORTANT NOTES: - The following errors were reported by the server: Domain: example.com Type: unauthorized Detail: Invalid response from http://example.com/.well-known/acme-challenge/jTcgYGTDkvxnX0ocm9NKrJyyM0rAgwwflurdfUURH_Q: " 403 Forbidden

Forbidden

```

Reason

This happens when you requested LetsEncrypt for new certificate, and LetsEncrypt system tries to contact your website in your web root under directory: .well-known

This is due to our web server are configured to deny accessing this directory.

Solution

Search below lines in your httpd.conf or .htaccess file.

#<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\..*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig\.save)$">
#  Order allow,deny
#</FilesMatch>

Replace above line with below line:

<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">

Your complete block will look like below:

<FilesMatch "\.(engine|inc|install|make|module|profile|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock))$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
  <IfModule mod_authz_core.c>
    Require all denied
  </IfModule>
  <IfModule !mod_authz_core.c>
    Order allow,deny
  </IfModule>
</FilesMatch>

Finally, restart your web server:

sudo service httpd restart

And, now try the command again. It works :)


Similar Posts

Latest Posts