Skip to content

Commit db42941

Browse files
authored
Return invalidProfile error for unsupported profiles (#521)
The error type is defined in all the published drafts of the spec and already implemented in Boulder.
1 parent 53b413c commit db42941

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
@@ -16,6 +16,7 @@ const (
1616
connectionErr = errNS + "connection"
1717
unauthorizedErr = errNS + "unauthorized"
1818
invalidContactErr = errNS + "invalidContact"
19+
invalidProfileErr = errNS + "invalidProfile"
1920
unsupportedContactErr = errNS + "unsupportedContact"
2021
accountDoesNotExistErr = errNS + "accountDoesNotExist"
2122
badRevocationReasonErr = errNS + "badRevocationReason"
@@ -134,6 +135,14 @@ func InvalidContactProblem(detail string) *ProblemDetails {
134135
}
135136
}
136137

138+
func InvalidProfileProblem(detail string) *ProblemDetails {
139+
return &ProblemDetails{
140+
Type: invalidProfileErr,
141+
Detail: detail,
142+
HTTPStatus: http.StatusBadRequest,
143+
}
144+
}
145+
137146
func UnsupportedContactProblem(detail string) *ProblemDetails {
138147
return &ProblemDetails{
139148
Type: unsupportedContactErr,

wfe/wfe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1747,7 +1747,7 @@ func (wfe *WebFrontEndImpl) NewOrder(
17471747
_, ok := profiles[profileName]
17481748
if !ok {
17491749
wfe.sendError(
1750-
acme.MalformedProblem(fmt.Sprintf("Order includes unrecognized profile name %q", profileName)), response)
1750+
acme.InvalidProfileProblem(fmt.Sprintf("Order includes unrecognized profile name %q", profileName)), response)
17511751
return
17521752
}
17531753

0 commit comments

Comments
 (0)