Vérifier la validité d’un certificat OpenSSL
vérifier la date d’expiration d’un certificat de sécurité OpenSSL
OpenSSL est basé sur l’excellente librairie SSLeay développée par Eric Young et Tim Hudson. La boîte à outils OpenSSL est licencié sous licence Apache de style, ce qui signifie essentiellement que vous êtes libre d’obtenir et d’utiliser à des fins commerciales et non commerciales sous réserve de certaines conditions très simples.
# cd /usr/local/bin
# wget http://prefetch.net/code/ssl-cert-check
# chmod +x ssl-cert-check
# ssl-cert-check -s www.votredomaine.com -p 443
# ssl-cert-check -c /etc/cert/fichiercacert.pem
# crontab
0 1 * * * ssl-cert-check -c /etc/cert/*.pem -e alert@domaine.com > /dev/null
# openssl s_server -cert
file
.pem -www
Script bash
#!/bin/bash # # check_cert.sh # # Boris HUISGEN <bhuisgen@hbis.fr> # if[ $# -eq 0 ]; then echo"$Usage: $0 <certificate_file>"; exit1; fi FILE=$1 if[ ! -e $FILE ] ; then echo"$1 file does not exist." exit2; fi EXPIRE_DATE=$(openssl x509 -in$FILE -noout -enddate | cut-f2 -d=); echo"Certificate file: $FILE"; echo"Expiration date: $EXPIRE_DATE"; exit 0;CACert Pour obtenir un certificat SSL gratuit multi-domaines signé par l’autorité CACert