Always set nbf and naf for new ACME orders ...

- Use the default value from the ACME provisioner if values are not
defined in the request.
This commit is contained in:
max furman 2020-05-19 18:44:55 -07:00
parent 2bc69d3edd
commit 6e69f99310
10 changed files with 220 additions and 26 deletions

View file

@ -278,11 +278,12 @@ func (h *Handler) lookupProvisioner(next nextHTTP) nextHTTP {
api.WriteError(w, err)
return
}
if p.GetType() != provisioner.TypeACME {
acmeProv, ok := p.(*provisioner.ACME)
if !ok {
api.WriteError(w, acme.AccountDoesNotExistErr(errors.New("provisioner must be of type ACME")))
return
}
ctx = context.WithValue(ctx, acme.ProvisionerContextKey, p)
ctx = context.WithValue(ctx, acme.ProvisionerContextKey, acme.Provisioner(acmeProv))
next(w, r.WithContext(ctx))
}
}