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
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
Now run dockerized certok using certok
// One with Warning certok --days=50 hostsfile
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