简体   繁体   English

在没有openssl命令的情况下获取SSL证书到期

[英]Get SSL Certificate expiration WITHOUT openssl command

I apologize if this is an ignorant question, but is there a way to get the expiration time from an SSL cert without running an SSL command in the terminal? 如果这是一个无知的问题,我深表歉意,但是有没有办法在终端中不运行SSL命令的情况下从SSL证书获取到期时间?

When I base64 decode the contents of the cert, some of the output is readable, but a lot of it is not. 当我base64解码cert的内容时,一些输出是可读的,但很多输出却不是。 The readable parts do not contain the expires information from what I can see. 可读的部分不包含我所看到的过期信息。

To be candid on my case, I am trying to run a MySQL command to get information on stored SSL certs. 坦率地说,我正在尝试运行MySQL命令来获取有关存储的SSL证书的信息。 So if there is a trick for MySQL, that would be cool too. 因此,如果有MySQL的窍门,那也很酷。

I found this text buried near the end of the second line in the base64 decoded cert: 150923190324Z160922190324Z 我发现此文本埋在base64解码证书的第二行末尾附近: 150923190324Z160922190324Z

This apparently contains the information I was looking for. 这显然包含了我正在寻找的信息。 This contains the notBefore and notAfter times, each containing 12 digits followed by a Z . 这包含notBeforenotAfter时间,每个时间包含12位数字,后跟一个Z

The format is YYMMDDHHMMSS . 格式为YYMMDDHHMMSS So in the example above i get: 所以在上面的例子中我得到:

Not Before: Sep 23 19:03:24 2015 GMT
Not After : Sep 22 19:03:24 2016 GMT

All without running an openssl command and only using base64 decoding. 所有这些都无需运行openssl命令,而仅使用base64解码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM