1、通过域名获取
方法一
echo | openssl s_client -servername 域名 -connect 域名:443 2>/dev/null | openssl x509 -noout -dates
结果:
notBefore=Oct 19 06:12:48 2020 GMT(起)
notAfter=Nov 20 06:12:48 2021 GMT(止)
方法二
curl -v "https//域名"
* start date: Jan 5 00:00:00 2021 GMT
* expire date: Jan 4 23:59:59 2022 GMT
方法三 浏览器
浏览器,左侧小黑锁->证书
2、通过证书获取
openssl x509 -in xxx.crt(证书文件名,不是key) -noout -text