Get SSL certificate expiry date quickly and easily with ckcrt script

SSL certificates are daily routine of my work, so there was regular practice to check expiry date of live certificate through Chrome browser -> Developer tools. It is quite time-consuming and annoying work if you have to repeat it. So I made this very simple bash script with which you can check expiry date and some other certificate information quickly, from your terminal. This will work on osx or linux machines. Of corse, you must have OpenSSL installed on your machine in order to use this script.

Installation:
– download this ckcrt script from here  
– extract zip file and move script to your /usr/local/bin directory
– make script executable: chmod +x ckcrt.sh
– 
you can now use it with command ckcrt (without path)

Here is how to use it:

> $ ckcrt geekytuts.net

---------------------------------------------------------------------
 Details for SSL certificate geekytuts.net
---------------------------------------------------------------------

Domain name: geekytuts.net
Expire date: Oct 25 21:02:00 2017 GMT
Certificate issuer: Let's Encrypt Authority X3
---------------------------------------------------------------------

And if you want to see current installed certificate, just use flag “show” at the end:

> $ ckcrt geekytuts.net show

---------------------------------------------------------------------
 Details for SSL certificate geekytuts.net
---------------------------------------------------------------------

Domain name: geekytuts.net
Expire date: Oct 25 21:02:00 2017 GMT
Certificate issuer: Let's Encrypt Authority X3

Certificate:

-----BEGIN CERTIFICATE-----
MIIFEDCCA/igAwIBAgISA78sHr2EWF2WSU3/IweGPbXaMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0xNzA3MjcyMTAyMDBaFw0x
NzEwMjUyMTAyMDBaMBgxFjAUBgNVBAMTDWdlZWt5dHV0cy5uZXQwggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDJ0Aj71U+mjLQAZtbqB7dlysJOXoYvAGf9
XqjVc/wLcLBTbuf1Jb0vH6NePkW6vkGWp+Vh9ZoeivywNhSiQaS401EnL6mk4xIO
PidGXrYoKcH6Q3SFvblzgaoo8g9KwcdGVs6qVuUsrJqQY+935IK1V9aV86RQFrdR
pRhXfXoz7hDojDED+73nCchc/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kDcpJeCXkL
gwx+rc3mvvIZd+2MG0joUm5tYU5k5RDXMq3jKMPI600W/Tk8Kv26aNlQlkULqNZC
dHZ8P+BHbcjaI/6ZuKCfgBkxf8qh1XmVOXm0Xy8QJC4Ghma43Mosd9WjfzFc7XmT
yBbhlVOJXn56IWbKT4yxKGomu8zvuOyn3iODXeV32NwHjwQL6+SrJPGThCCY7ppY
mpC2NQ==
-----END CERTIFICATE-----

---------------------------------------------------------------------

I hope it saves you some time :)

Got Something To Say:

Your email address will not be published. Required fields are marked *

*

I accept the Privacy Policy

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2024 geegkytuts.net
Hosted by SIEL


About author