Skip to content

Commit cc7ec55

Browse files
committed
Reply with alreadyReplaced problem when certificate has already been replaced
1 parent 23ab0be commit cc7ec55

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

acme/problems.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const (
2525
badPublicKeyErr = errNS + "badPublicKey"
2626
badSignatureAlgorithmErr = errNS + "badSignatureAlgorithm"
2727
rejectedIdentifierErr = errNS + "rejectedIdentifier"
28+
alreadyReplacedErr = errNS + "alreadyReplaced"
2829
)
2930

3031
type ProblemDetails struct {
@@ -221,3 +222,11 @@ func RejectedIdentifierProblem(ident Identifier, detail string) *ProblemDetails
221222
},
222223
}
223224
}
225+
226+
func AlreadyReplaced(detail string) *ProblemDetails {
227+
return &ProblemDetails{
228+
Type: alreadyReplacedErr,
229+
Detail: detail,
230+
HTTPStatus: http.StatusConflict,
231+
}
232+
}

wfe/wfe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ func (wfe *WebFrontEndImpl) validateReplacementOrder(newOrder *core.Order) *acme
16831683
}
16841684

16851685
if originalOrder.IsReplaced {
1686-
return acme.Conflict(fmt.Sprintf("cannot indicate an order replaces certificate with serial %s, which already has a replacement order", certID.SerialHex()))
1686+
return acme.AlreadyReplaced(fmt.Sprintf("certificate with serial %s already has a replacement order", certID.SerialHex()))
16871687
}
16881688

16891689
if originalOrder.AccountID != newOrder.AccountID {

0 commit comments

Comments
 (0)