Last active
September 9, 2023 09:04
-
-
Save niklasvincent/de45c3310e858cb50d1131ca981d3dd8 to your computer and use it in GitHub Desktop.
Let's Encrypt Certificates SHA256 fingerprint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASE_URL="https://letsencrypt.org/certs/" | |
CERTIFICATES="lets-encrypt-x3-cross-signed.pem lets-encrypt-x4-cross-signed.pem lets-encrypt-x1-cross-signed.pem lets-encrypt-x2-cross-signed.pem" | |
for CERTIFICATE in $CERTIFICATES; do | |
echo "# $CERTIFICATE " | |
curl --silent "${BASE_URL}${CERTIFICATE}" | openssl x509 -noout -fingerprint -sha256 -inform pem | cut -d'=' -f2 | tr '[:upper:]' '[:lower:]' | sed -e 's/://g' | | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
have an error in GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu):
lets-encrypt-sha256.sh: line 9: syntax error near unexpected token `done'
lets-encrypt-sha256.sh: line 9: `done'
fixed with deleted last | character in line 8