function sslcheckdate --description "Check the validity date of a distant SSL server" # PEM format echo "Validity dates of certificat of $argv[1] on port 443 (PEM format)" echo "Q" | openssl s_client -servername $argv[1] -connect $argv[1]:443 2>/dev/null | openssl x509 -noout -dates end