SSL Certificate not working for non-www domain

Hi

I am using Nginx
I have generate a wildcard ssl certificate ie *.example.com
bu using this command
./certbot-auto certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns -d *.example.com

But this certificate is only working for www.example.com and doesn’t working for example.com

so is there any way to use this certificate for both www & non-www.

Please let me know how to fix this

Regards
Ankit Gupta

Yes, that's exactly correct. *.example.com will cover subdomains of example.com, but not example.com itself--as a very cursory search would have revealed. If you want to cover example.com on the same cert, you'll need to issue a new cert covering both *.example.com and example.com.

ok
but please tell how to do that.

Similar command to what you used before:

./certbot-auto certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns -d example.com -d "*.example.com"

2 Likes

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