diff --git a/akamai/cache-client.go b/akamai/cache-client.go index 33af6e798..167ebcd30 100644 --- a/akamai/cache-client.go +++ b/akamai/cache-client.go @@ -357,13 +357,11 @@ func generateOCSPCacheKeys(req []byte, ocspServer string) []string { } } -// GeneratePurgeURLs ... -func GeneratePurgeURLs(der []byte, issuer *x509.Certificate) ([]string, error) { - cert, err := x509.ParseCertificate(der) - if err != nil { - return nil, err - } - +// GeneratePurgeURLs generates akamai URLs that can be POSTed to in order to +// purge akamai's cache of the corresponding OCSP responses. The URLs encode +// the contents of the OCSP request, so this method constructs a full OCSP +// request. +func GeneratePurgeURLs(cert, issuer *x509.Certificate) ([]string, error) { req, err := ocsp.CreateRequest(cert, issuer, nil) if err != nil { return nil, err diff --git a/ra/ra.go b/ra/ra.go index b2dbdd805..bdc0520bc 100644 --- a/ra/ra.go +++ b/ra/ra.go @@ -1711,7 +1711,7 @@ func (ra *RegistrationAuthorityImpl) revokeCertificate(ctx context.Context, cert return err } } - purgeURLs, err := akamai.GeneratePurgeURLs(cert.Raw, ra.issuer.Certificate) + purgeURLs, err := akamai.GeneratePurgeURLs(&cert, ra.issuer.Certificate) if err != nil { return err }