Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking the expiry dates of SSL certs

I wrote a script to find the expiry dates of SSL cert in a directory.

shopt -s nullglob
for f in *.0 *.pem *.key *.crt; do
    echo "## CERTIFICATE NAME -> $f ##"
     openssl x509 -noout -in $f   -issuer -subject -dates  
    echo ""
done

Are there any improvements on this?

like image 800
Dave Avatar asked Nov 08 '25 06:11

Dave


1 Answers

Please check cmd to get Expected ans :

openssl x509 -noout -text -in abc.cer | grep Not

Output :
        Not Before: Aug 30 10:14:54 2018 GMT
        Not After : Aug 29 10:14:54 2021 GMT

Description : Use your .cer or crt certificate name

like image 101
Wajid Shaikh Avatar answered Nov 11 '25 12:11

Wajid Shaikh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!