# Invalid cert for www

**URL:** <https://community.letsencrypt.org/t/invalid-cert-for-www/101371>\
**Category:** Help\
**Created:** [September 5, 2019, 11:04am UTC](https://community.letsencrypt.org/t/invalid-cert-for-www/101371 "2019-09-05T11:04:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![arualris](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@arualris](https://community.letsencrypt.org/u/arualris)\
**Post date:** [September 5, 2019, 11:04am UTC](https://community.letsencrypt.org/t/invalid-cert-for-www/101371/1 "2019-09-05T11:04:39Z")

</div>

My Let'sEncrypt cert is active and works for [whitecathearing.com](http://whitecathearing.com), but when I tried to add the cert for [www.whitecathearing.com](http://www.whitecathearing.com) it gives me an invalid cert error on my browser.

My domain is:  
[whitecathearing.com](http://whitecathearing.com)

I ran this command:  
sudo certbot --nginx -d [www.whitecathearing.com](http://www.whitecathearing.com)

It produced this output:

> - Congratulations! Your certificate and chain have been saved at:  
> /etc/letsencrypt/live/www.whitecathearing.com/fullchain.pem  
> Your key file has been saved at:  
> /etc/letsencrypt/live/www.whitecathearing.com/privkey.pem  
> Your cert will expire on 2019-12-04. To obtain a new or tweaked  
> version of this certificate in the future, simply run certbot again  
> with the "certonly" option. To non-interactively renew _all_ of  
> your certificates, run "certbot renew"

My web server is (include version):  
Amazon Lightsail

The operating system my web server runs on is (include version):  
CentOs7

My hosting provider, if applicable, is:  
I'm currently still using [wix.com](http://wix.com) to host my domain name. I have configured my A records to point both [whitecathearing.com](http://whitecathearing.com) and [www.whitecathearing.com](http://www.whitecathearing.com) to my IP address.

I can login to a root shell on my machine (yes or no, or I don't know):  
Yes

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):  
Yes, I'm using Odoo

The version of my client is (e.g. output of `certbot --version` or `certbot-auto --version` if you're using Certbot):  
certbot 0.36.0

---

<div class="post-metadata">

**Author:** ![arualris](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@arualris](https://community.letsencrypt.org/u/arualris)\
**Post date:** [September 5, 2019, 11:11am UTC](https://community.letsencrypt.org/t/invalid-cert-for-www/101371/2 "2019-09-05T11:11:14Z")

</div>

Sorry, I managed to fix this!

In case others are interested, I reran the command with:  
sudo certbot --nginx -d [whitecathearing.com](http://whitecathearing.com) -d [www.whitecathearing.com](http://www.whitecathearing.com)

This gave me the option to expand and replace my existing certificates 🙂

Thanks for this awesome tool!

---

<div class="post-metadata">

**Author:** ![danb35](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/danb35/32/70869_2.png) [@danb35](https://community.letsencrypt.org/u/danb35)\
**Post date:** [September 5, 2019, 11:12am UTC](https://community.letsencrypt.org/t/invalid-cert-for-www/101371/3 "2019-09-05T11:12:23Z")

</div>

> [@arualris](#):
>
> it gives me an invalid cert error on my browser.

Could you post a screen shot of the error? Because this is what I see when I browse to www:

 ![image](https://global.discourse-cdn.com/letsencrypt/original/3X/7/6/7695bbe04d2060895b385b0569c8b30a7a55ab54.jpeg)  
www redirects to non-www (which is good), and that's secure. There's a mixed content warning because some of your content is loaded by http links rather than https, so you'll need to fix that in your content.

---

<div class="post-metadata">

**Author:** ![JuergenAuer](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/juergenauer/32/26491_2.png) [@JuergenAuer](https://community.letsencrypt.org/u/JuergenAuer)\
**Post date:** [September 5, 2019, 1:31pm UTC](https://community.letsencrypt.org/t/invalid-cert-for-www/101371/4 "2019-09-05T13:31:26Z")

</div>

Hi @arualris

> [@arualris](#):
>
> In case others are interested, I reran the command with:  
> sudo certbot --nginx -d [whitecathearing.com](http://whitecathearing.com) -d [www.whitecathearing.com](http://www.whitecathearing.com)
> 
> This gave me the option to expand and replace my existing certificates 🙂

yep, if you have both domain names (non-www and www), the easiest solution is to use two -d parameters and create one certificate with both domain names.

So you have one vHost with two domain names and one certificate with the same combination.

---

<div class="post-metadata">

**Author:** ![tychoash](https://avatars.discourse-cdn.com/v4/letter/t/258eb7/32.png) [@tychoash](https://community.letsencrypt.org/u/tychoash)\
**Post date:** [September 16, 2019, 5:19pm UTC](https://community.letsencrypt.org/t/invalid-cert-for-www/101371/5 "2019-09-16T17:19:30Z")

</div>

You can also do this when renewing certificates. I had created my original certificate and forget adding www, so I was getting an error. I added the www domain when I was renewing the cert and voila, no more error. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [October 16, 2019, 5:30pm UTC](https://community.letsencrypt.org/t/invalid-cert-for-www/101371/6 "2019-10-16T17:30:43Z")

</div>

Closed on October 16, 2019, 5:30pm UTC

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