# Net::err\_cert\_common\_name\_invalid

**URL:** <https://community.letsencrypt.org/t/net-err-cert-common-name-invalid/166392>\
**Category:** Help\
**Created:** [November 25, 2021, 9:55pm UTC](https://community.letsencrypt.org/t/net-err-cert-common-name-invalid/166392 "2021-11-25T21:55:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jedi](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jedi/32/24987_2.png) [@Jedi](https://community.letsencrypt.org/u/Jedi)\
**Post date:** [November 25, 2021, 9:55pm UTC](https://community.letsencrypt.org/t/net-err-cert-common-name-invalid/166392/1 "2021-11-25T21:55:22Z")

</div>

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. [crt.sh | example.com](https://crt.sh/?q=example.com)), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:shesheds.co.nz

I ran this command:certbot certificates

It produced this output:Found the following certs:  
Certificate Name: shesheds.co.nz  
Domains: nextcloud.shesheds.co.nz www.nextcloud.shesheds.co.nz www.shesheds.co.nz  
Expiry Date: 2022-02-03 07:29:31+00:00 (VALID: 69 days)  
Certificate Path: /etc/letsencrypt/live/shesheds.co.nz/fullchain.pem  
Private Key Path: /etc/letsencrypt/live/shesheds.co.nz/privkey.pem

My web server is (include version):nginx/1.18.0

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

My hosting provider, if applicable, is:

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):no

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

This is the relevant part of my nginx config:

```nohighlight
    ssl_certificate /etc/letsencrypt/live/shesheds.co.nz/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/shesheds.co.nz/privkey.pem;

      ssl_trusted_certificate /etc/letsencrypt/live/shesheds.co.nz/chain.pem;

```

When I view the certificate in the browser it says it is for nextcloud.shesheds.co.nz which is possibly the cause of the error but I don't know how to rectify that.

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [November 25, 2021, 10:32pm UTC](https://community.letsencrypt.org/t/net-err-cert-common-name-invalid/166392/2 "2021-11-25T22:32:42Z")

</div>

> [@Jedi](#):
>
> which is possibly the cause of the erro

What error?

You have a cert with three names on it; They can't all be first on that list.  
[crt.sh | shesheds.co.nz](https://crt.sh/?Identity=shesheds.co.nz&exclude=expired&deduplicate=Y)

> [@Jedi](#):
>
> Certificate Name: shesheds.co.nz  
> Domains: nextcloud.shesheds.co.nz www.nextcloud.shesheds.co.nz www.shesheds.co.nz

Unless...  
You actually need four names on it.  
[SSL Server Test: shesheds.co.nz (Powered by Qualys SSL Labs)](https://www.ssllabs.com/ssltest/analyze.html?d=shesheds.co.nz)

---

<div class="post-metadata">

**Author:** ![Jedi](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/jedi/32/24987_2.png) [@Jedi](https://community.letsencrypt.org/u/Jedi)\
**Post date:** [November 25, 2021, 11:31pm UTC](https://community.letsencrypt.org/t/net-err-cert-common-name-invalid/166392/3 "2021-11-25T23:31:20Z")

</div>

Yes I needed four names on the certificate.

Solution was

```nohighlight
certbot --nginx --agree-tos --redirect --staple-ocsp -d shesheds.co.nz -d www.shesheds.co.nz -d nextcloud.shesheds.co.nz -d www.nextcloud.shesheds.co.nz --email info@shesheds.co.nz

```

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [November 26, 2021, 6:20am UTC](https://community.letsencrypt.org/t/net-err-cert-common-name-invalid/166392/4 "2021-11-26T06:20:09Z")

</div>

You should review the certs now being maintained by certbot and delete any that are no longer needed nor being used.

`certbot certificates`

---

<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:** [December 26, 2021, 6:20am UTC](https://community.letsencrypt.org/t/net-err-cert-common-name-invalid/166392/5 "2021-12-26T06:20:51Z")

</div>

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