002_监测ssl证书过期时间

一、

s_client This implements a generic SSL/TLS client which can establish a transparent connection to a remote server speaking SSL/TLS. It's intended for testing purposes only and provides only rudimentary(基本的) interface functionality but internally uses mostly all functionality of the OpenSSL ssl library.

x509      X.509 Certificate Data Management.

sudo openssl s_client -connect www.baidu.com:443 < /dev/null 2>/dev/null| openssl x509 -text|egrep "Not After" 2>/dev/null| sed -e 's/^ *//g'| cut -d " " -f 4,5,6,7,8
Nov 16 23:59:59 2017 GMT

  

原文地址:https://www.cnblogs.com/arun-python/p/7153789.html