check ssl pem expiry date code example
Example 1: check pem expiration date
openssl x509 -enddate -noout -in file.pem
Example 2: script to get pem expiration date
$ openssl pkcs12 -in mycert.p12 -nodes | openssl x509 -noout -enddate
openssl x509 -enddate -noout -in file.pem
$ openssl pkcs12 -in mycert.p12 -nodes | openssl x509 -noout -enddate