# How to find Certifications Expiry Date

**URL:** <https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661>\
**Category:** Help\
**Created:** [December 19, 2017, 1:21pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661 "2017-12-19T13:21:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinicius.soccol](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/vinicius.soccol/32/18786_2.png) [@vinicius.soccol](https://community.letsencrypt.org/u/vinicius.soccol)\
**Post date:** [December 19, 2017, 1:21pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/1 "2017-12-19T13:21:43Z")

</div>

Good Morning!  
I have the following doubt:  
Which command should I run to check the expiration date of my certificates on my server?  
Operating System: Ubuntu  
Thank you!

---

<div class="post-metadata">

**Author:** ![bytecamp](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@bytecamp](https://community.letsencrypt.org/u/bytecamp)\
**Post date:** [December 19, 2017, 1:26pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/2 "2017-12-19T13:26:02Z")

</div>

You can use the openssl tools for that:

> $ openssl x509 -dates -noout \< /path/to/certificate

---

<div class="post-metadata">

**Author:** ![vinicius.soccol](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/vinicius.soccol/32/18786_2.png) [@vinicius.soccol](https://community.letsencrypt.org/u/vinicius.soccol)\
**Post date:** [December 19, 2017, 1:36pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/3 "2017-12-19T13:36:09Z")

</div>

But I have many certificates on server, each one in one folder, with the following files in folders:

- cert.pem;
- chain.pem;
- fullchain.pem;
- privkey.pem

Which of the files should I specify on the command?

---

<div class="post-metadata">

**Author:** ![bytecamp](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@bytecamp](https://community.letsencrypt.org/u/bytecamp)\
**Post date:** [December 19, 2017, 1:38pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/4 "2017-12-19T13:38:21Z")

</div>

> [@vinicius.soccol](#):
>
> Which of the files should I specify on the command?

cert.pem, because this is the leaf certificate.

---

<div class="post-metadata">

**Author:** ![vinicius.soccol](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/vinicius.soccol/32/18786_2.png) [@vinicius.soccol](https://community.letsencrypt.org/u/vinicius.soccol)\
**Post date:** [December 19, 2017, 1:41pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/5 "2017-12-19T13:41:43Z")

</div>

I tried to run the following command:  
sudo openssl x509 -dates -noout \< /etc/letsencrypt/live/admin.mypharma.net.br/cert.pem

But it showed me this:  
-bash: /etc/letsencrypt/live/admin.mypharma.net.br/cert.pem: Permission denied

---

<div class="post-metadata">

**Author:** ![bytecamp](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@bytecamp](https://community.letsencrypt.org/u/bytecamp)\
**Post date:** [December 19, 2017, 1:42pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/6 "2017-12-19T13:42:50Z")

</div>

Please show output of command:

$ ls -l /etc/letsencrypt/live/admin.mypharma.net.br/cert.pem

---

<div class="post-metadata">

**Author:** ![vinicius.soccol](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/vinicius.soccol/32/18786_2.png) [@vinicius.soccol](https://community.letsencrypt.org/u/vinicius.soccol)\
**Post date:** [December 19, 2017, 1:43pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/7 "2017-12-19T13:43:56Z")

</div>

But I used sudo to run the command.

---

<div class="post-metadata">

**Author:** ![bytecamp](https://avatars.discourse-cdn.com/v4/letter/b/54ee81/32.png) [@bytecamp](https://community.letsencrypt.org/u/bytecamp)\
**Post date:** [December 19, 2017, 1:47pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/8 "2017-12-19T13:47:37Z")

</div>

Ah, the problem is sudo invocation. The redirect of standard input seems to happen before privilege expansion.

Just try:

> $ sudo openssl x509 -dates -noout -in /path/to/cert.pem

---

<div class="post-metadata">

**Author:** ![vinicius.soccol](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/vinicius.soccol/32/18786_2.png) [@vinicius.soccol](https://community.letsencrypt.org/u/vinicius.soccol)\
**Post date:** [December 19, 2017, 1:50pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/9 "2017-12-19T13:50:52Z")

</div>

It worked now.  
Thanks 🙂

---

<div class="post-metadata">

**Author:** ![cpu](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/cpu/32/84514_2.png) [@cpu](https://community.letsencrypt.org/u/cpu)\
**Post date:** [December 19, 2017, 1:54pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/10 "2017-12-19T13:54:37Z")

</div>

> [@vinicius.soccol](#):
>
> Which command should I run to check the expiration date of my certificates on my server?

Hi @vinicius.soccol,

Are you using Certbot? If so the command [`certbot certificates`](https://certbot.eff.org/docs/using.html#managing-certificates) will show output that includes the expiry and is easier to use than `openssl`:

```nohighlight
Found the following certs:
  Certificate Name: example.com
    Domains: example.com, www.example.com
    Expiry Date: 2017-02-19 19:53:00+00:00 (VALID: 30 days)
    Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem

```

---

<div class="post-metadata">

**Author:** ![vinicius.soccol](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/vinicius.soccol/32/18786_2.png) [@vinicius.soccol](https://community.letsencrypt.org/u/vinicius.soccol)\
**Post date:** [December 19, 2017, 1:55pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/11 "2017-12-19T13:55:52Z")

</div>

Ok, I’ll try this command.  
Thankyou.

---

<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:** [January 18, 2018, 1:56pm UTC](https://community.letsencrypt.org/t/how-to-find-certifications-expiry-date/48661/12 "2018-01-18T13:56:20Z")

</div>

Closed on January 18, 2018, 1:56pm UTC

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