1、域名获取
openssl s_client -servername 域名 -connect 域名:443 | openssl x509 -noout -dates
echo | openssl s_client -servername 域名 -connect 域名:443 2>/dev/null | openssl x509 -noout -dates
显示:
notBefore=Apr 14 06:18:55 2023 GMT
notAfter=Apr 13 06:18:54 2024 GMT
2.curl
curl -v "https//域名"
显示:
* start date: 4月 14 06:18:55 2023 GMT
* expire date: 4月 13 06:18:54 2024 GMT
3、通过证书获取
openssl x509 -in xxxx.pem(证书文件名,不是key) -noout -text
显示:
Not Before: Jun 25 01:15:26 2023 GMT
Not After : Jun 24 01:15:25 2024 GMT