parent
8b9ed777d1
commit
09f87bb31a
|
|
@ -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...)
|
||||
}
|
||||
|
|
|
|||
2
ra/ra.go
2
ra/ra.go
|
|
@ -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, ","),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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/"),
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue