Skip to content
Snippets Groups Projects

Bulk leaf certificate expiry check

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Erick Hitter

    Report subject and expiry for multiple PEM .crt files.

    check-expiry.sh 219 B
    #!/bin/bash
    
    printf "CHECKING EXPIRATIONS\n\n"
    
    for f in *.crt
    do
    	COMMON_NAME=`openssl x509 -noout -subject -in "$f"`
    	EXPIRES=`openssl x509 -enddate -noout -in "$f"`
    	printf "%s\n%s\n\n" "$COMMON_NAME" "$EXPIRES"
    done
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment