DEV Community

Discussion on: Let’s Encrypt SSL certificate in Namecheap AutoRenewal – Verified & working – Using ACME.sh

Collapse
 
daveelton profile image
Dave Elton • Edited

The redirect method for www. has a snag. Most browsers seem to look for a www.mydomain.com cert before following the redirect. This results in users seeing a warning and not redirecting.

The solution is to add a second domain arg to each of the commands. EG:

acme.sh --issue --webroot ~/public_html -d mydomain.com -d www.mydomain.com --staging

acme.sh --issue --webroot ~/public_html -d mydomain.com -d www.mydomain.com --force

acme.sh --deploy --deploy-hook cpanel_uapi --domain mydomain.com --domain www.mydomain.com
Enter fullscreen mode Exit fullscreen mode

You'll still want to add the redirect, but this will now avoid the error for users.

Collapse
 
revdev profile image
RevDev

I noticed and tried to add a certificate for www using this script and everything said in this thread, but it does not add it. I says

The domain 'abc' seems to already have an ECC cert, let's use it.
[Tue Feb 11 12:26:24 EST 2025] Applying sitelist filter DEPLOY_CPANEL_AUTO_INCLUDE: *
[Tue Feb 11 12:26:24 EST 2025] Applying sitelist filter DEPLOY_CPANEL_AUTO_EXCLUDE:
[Tue Feb 11 12:26:24 EST 2025] Successfully deployed certificate to 0 of 0 sites via UAPI

and no certificate is added. Any suggestion would be really appreciated. With some domains it seems to work in the same hosting package...