Created
October 22, 2019 17:14
-
-
Save matthiasbaldi/d1e34e1f12529bf324056d611ea5e570 to your computer and use it in GitHub Desktop.
Traefik 2.0 revoke Let's Encrypt cerificate
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
#!/usr/bin/env bash | |
# credits: https://github.com/containous/traefik/issues/635#issuecomment-400423859 | |
# usage: revokeCert.sh {yourDomainToRevoke} | |
# the JSON path changed a bit compared with Traefik v1 | |
set -e | |
ACME_FILE=/traefik/path/traefik/acme.json # change | |
jq -r ".default.Certificates | .[] | select(.domain.main == \"$1\").key" < $ACME_FILE | base64 --decode > /tmp/a.key | |
jq -r ".default.Certificates | .[] | select(.domain.main == \"$1\").certificate" < $ACME_FILE | base64 --decode > /tmp/a.pem | |
letsencrypt revoke -d "$1" --key-path /tmp/a.key --cert-path /tmp/a.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment