本文介绍了如何从 PEM 编码的证书中确定 SSL 证书的到期日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我在 Mac 或 Linux 中有实际文件和 Bash shell,我如何查询证书文件的到期时间?不是网站,而是证书文件本身,假设我有 csr、密钥、pem 和链文件.
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, assuming I have the csr, key, pem and chain files.
推荐答案
With openssl
:
openssl x509 -enddate -noout -in file.pem
输出在表单上:
notAfter=Nov 3 22:23:50 2014 GMT
另请参阅MikeW 的回答,了解如何轻松检查证书是否已过期,或者是否会在特定时间段,无需解析上面的日期.
Also see MikeW's answer for how to easily check whether the certificate has expired or not, or whether it will within a certain time period, without having to parse the date above.
这篇关于如何从 PEM 编码的证书中确定 SSL 证书的到期日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!