I came across an issue this morning where Auto SSl was failing due to the directory being password protected.
Example Log.
To get around this I've added a .htaccess file in the .well-known directory
This seems to work but it is unclear if this will get removed at some point.
An alternative I found prior to this was to add an Allow from into the .htaccess with the AuthuserFile lines but this bypasses the password to the entire directory for that IP.
I wanted to allow secure.comodo.net, but this failed so I looked up the IP and allowed that instead which worked and AutoSSL obtained a new IP, (secure.comodo.net currently has address 91.199.212.132) I can see this failing if the IP ever changes so opted for the .htaccess in the .well-known directory.
I'm going to continue looking into why the fqdn didn't work as the documentation suggests a fqdn should work, but i'll be looking to put it in the .well-known/.htaccess to make that directory as secure as possible.
I couldn't find a suitable solution on the forums so thought i'd share my findings this morning.
Example Log.
The “cPanel” AutoSSL provider could not renew the SSL certificate without a reduction of coverage because of the following problem:
sub.domain.co.uk [ Last AutoSSL Run at “2017-11-15 at 21:14:04 UTC” ]
The system queried for a temporary file at “http://sub.domain.co.uk/.well-known/pki-validation/***************.txt”, but the web server responded with the following error: 401 (Unauthorized). A DNS (Domain Name System) or web server misconfiguration may exist.
To get around this I've added a .htaccess file in the .well-known directory
Code:
Satisfy Any
Order Allow,Deny
Allow from all
An alternative I found prior to this was to add an Allow from into the .htaccess with the AuthuserFile lines but this bypasses the password to the entire directory for that IP.
Code:
AuthUserFile "/home/.../passwd"
AuthName "Password"
AuthType Basic
require valid-user
#Added lines below
Order deny,allow
Allow from 91.199.212.132
Satisfy Any
I'm going to continue looking into why the fqdn didn't work as the documentation suggests a fqdn should work, but i'll be looking to put it in the .well-known/.htaccess to make that directory as secure as possible.
I couldn't find a suitable solution on the forums so thought i'd share my findings this morning.