howtos:how_do_i_retrieve_a_remote_certificate
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | howtos:how_do_i_retrieve_a_remote_certificate [02/12/2018 21:34] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | This script retrieves the certificate of the site you target: | ||
+ | < | ||
+ | #!/bin/sh | ||
+ | # | ||
+ | # usage: retrieve-cert.sh remote.host.name [port] | ||
+ | # | ||
+ | REMHOST=$1 | ||
+ | REMPORT=${2: | ||
+ | |||
+ | echo |\ | ||
+ | openssl s_client -connect ${REMHOST}: | ||
+ | sed -ne '/ | ||
+ | </ | ||
+ | |||
+ | This script checks a list of sites for their expire date: | ||
+ | |||
+ | < | ||
+ | #!/bin/sh | ||
+ | # | ||
+ | for CERT in \ | ||
+ | www.yourdomain.com: | ||
+ | ldap.yourdomain.com: | ||
+ | imap.yourdomain.com: | ||
+ | do | ||
+ | echo |\ | ||
+ | openssl s_client -connect ${CERT} 2>/ | ||
+ | sed -ne '/ | ||
+ | openssl x509 -noout -subject -dates | ||
+ | done | ||
+ | </ | ||
+ |
howtos/how_do_i_retrieve_a_remote_certificate.txt · Last modified: 02/12/2018 21:34 by 127.0.0.1