Skip to content

Commit

Permalink
MakeARICertID: use RawURLEncoding instead of trimming
Browse files Browse the repository at this point in the history
  • Loading branch information
beautifulentropy authored and ldez committed Feb 24, 2024
1 parent 13a423e commit 79e475e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions certificate/renewal.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"errors"
"fmt"
"math/rand"
"strings"
"time"

"github.com/go-acme/lego/v4/acme"
Expand Down Expand Up @@ -91,7 +90,7 @@ func MakeARICertID(leaf *x509.Certificate) (string, error) {
}

return fmt.Sprintf("%s.%s",
strings.TrimRight(base64.URLEncoding.EncodeToString(leaf.AuthorityKeyId), "="),
strings.TrimRight(base64.URLEncoding.EncodeToString(leaf.SerialNumber.Bytes()), "="),
base64.RawURLEncoding.EncodeToString(leaf.AuthorityKeyId),
base64.RawURLEncoding.EncodeToString(leaf.SerialNumber.Bytes()),
), nil
}

0 comments on commit 79e475e

Please sign in to comment.