Skip to content

Instantly share code, notes, and snippets.

@niklasvincent
Last active September 9, 2023 09:04
Show Gist options
  • Save niklasvincent/de45c3310e858cb50d1131ca981d3dd8 to your computer and use it in GitHub Desktop.
Save niklasvincent/de45c3310e858cb50d1131ca981d3dd8 to your computer and use it in GitHub Desktop.
Let's Encrypt Certificates SHA256 fingerprint
#!/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
@Nikitossh
Copy link

Nikitossh commented Jan 17, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment