RA: Update duplicate certificate error URL (#6181)

Resolves #6164
This commit is contained in:
Samantha 2022-06-21 10:35:30 -07:00 committed by GitHub
parent 8b9ed777d1
commit 09f87bb31a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -114,6 +114,13 @@ func RateLimitError(msg string, args ...interface{}) error {
}
}
func DuplicateCertificateError(msg string, args ...interface{}) error {
return &BoulderError{
Type: RateLimit,
Detail: fmt.Sprintf(msg+": see https://letsencrypt.org/docs/duplicate-certificate-limit/", args...),
}
}
func RejectedIdentifierError(msg string, args ...interface{}) error {
return New(RejectedIdentifier, msg, args...)
}

View File

@ -1376,7 +1376,7 @@ func (ra *RegistrationAuthorityImpl) checkCertificatesPerFQDNSetLimit(ctx contex
names = core.UniqueLowerNames(names)
threshold := limit.GetThreshold(strings.Join(names, ","), regID)
if count.Count >= threshold {
return berrors.RateLimitError(
return berrors.DuplicateCertificateError(
"too many certificates (%d) already issued for this exact set of domains in the last %.0f hours: %s",
threshold, limit.Window.Duration.Hours(), strings.Join(names, ","),
)

View File

@ -1246,12 +1246,12 @@ func TestCheckExactCertificateLimit(t *testing.T) {
{
Name: "FQDN set issuances equal to limit",
Domain: "equal.example.com",
ExpectedErr: fmt.Errorf("too many certificates (3) already issued for this exact set of domains in the last 23 hours: equal.example.com: see https://letsencrypt.org/docs/rate-limits/"),
ExpectedErr: fmt.Errorf("too many certificates (3) already issued for this exact set of domains in the last 23 hours: equal.example.com: see https://letsencrypt.org/docs/duplicate-certificate-limit/"),
},
{
Name: "FQDN set issuances above limit",
Domain: "over.example.com",
ExpectedErr: fmt.Errorf("too many certificates (3) already issued for this exact set of domains in the last 23 hours: over.example.com: see https://letsencrypt.org/docs/rate-limits/"),
ExpectedErr: fmt.Errorf("too many certificates (3) already issued for this exact set of domains in the last 23 hours: over.example.com: see https://letsencrypt.org/docs/duplicate-certificate-limit/"),
},
}