How to Find Expiry of SSL Certificates using Command line (certok) using Docker?

certok (cert ok) is a command-line tool that can quickly give you information related to SSL certificates.

If you have go – you can simply install certok inside the system by following command:

go get github.com/genuinetools/certok

Using Docker

I have created a docker image which can be used in place of go tool which is only 11mb in size.

Simply use it like following:

docker run --rm -it -v $(pwd):/app --user $(id -u):$(id -g) varunbatrait/certok:latest

Add it as alias: You can add the following line to your .zshrc file or .bashrc file.

alias certok='docker run --rm -it -v $(pwd):/app --user $(id -u):$(id -g) varunbatrait/certok:latest'

Usage with certok as Docker

Provided that you have added an alias you can use it like following

Create a hostsfile (or any file) with domains

webapplicationconsultant.com
varunbatra.com

Now run dockerized certok using certok

certok hostsfile
// One with Warning
certok --days=50 hostsfile

Sample output

NAME                              SUBJECT                         ISSUER                      ALGO                EXPIRES             SUNSET DATE         ERROR
varunbatra.com:443                *.varunbatra.com                Let's Encrypt Authority X3  SHA256-RSA          81 days                                 
webapplicationconsultant.com:443  *.webapplicationconsultant.com  Let's Encrypt Authority X3  SHA256-RSA          48 days                                 

Worth Sharing?

1 Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>