I have a Microsoft CA running, which does not have the SAN field enabled by default, so I have enabled it by
certutil -setreg policy\EditFlags +EDITF_ATTRIBUTESUBJECTALTNAME2
Before doing so, everything worked normally. After enabling the SAN field, when I'm submitting a signing request, I'm getting this error:
Your Request Id is XXX. The disposition message is “Denied by Policy Module
The certificate validity period will be shorter than the Certificate
Template specifies, because the template validity period is longer than the
maximum certificate validity period allowed by the CA. Consider renewing the
CA certificate, reducing the template validity period, or increasing the
registry validity period.
The certificate template for which I'm trying to request a certificate has 2 years for validity, and my issuing CA's certificate is still valid for 1.5 years. If I revert the flag change for SAN with
certutil -setreg policy\EditFlags -EDITF_ATTRIBUTESUBJECTALTNAME2
then I can issue certificates like before.
I've seen a possible solution recommended raising the below:
certutil -setreg ca\ValidatePeriod "Years"
certutil -setreg ca\ValidityPeriodUnits 5
which does not work (tried it) in my case, but I don't understand how this would solve it anyway, as at the end of the day, the expiration date of my issuing CA's certificate would take precende over this, if I understand it correctly. I don't understand why I'm getting this error only with the SAN field being enabled.
How can I solve this? Does enabling the SAN imply any further checks on the CA, which I've missed somehow?