How to determine SSL cert expiration date from a PEM encoded certificate?

前端 未结 9 2084
感动是毒
感动是毒 2020-11-30 16:21

If I have the actual file and a Bash shell in Mac or Linux, how can I query the cert file for when it will expire? Not a web site, but actually the certificate file itself,

9条回答
  •  -上瘾入骨i
    2020-11-30 16:48

    Same as accepted answer, But note that it works even with .crt file and not just .pem file, just in case if you are not able to find .pem file location.

    openssl x509 -enddate -noout -in e71c8ea7fa97ad6c.crt
    

    Result:

    notAfter=Mar 29 06:15:00 2020 GMT
    

提交回复
热议问题