#9340 new lightweight CA cannot be added with a customized subject DN
Closed: wontfix by rcritten. Opened by ogonzales.

Request for enhancement

A new CA should be created with a customized subject DN

Issue

Unable to add a CA with subject as "dnQualifier=12345, CN=pre CA"

Steps to Reproduce

  1. Login as admin
  2. ipa ca-add preca --subject="dnQualifier=12345, CN=pre CA"
  3. Ipa: ERROR: Request failed with status 400: Non-2xx response from CA REST API: 400. Unable to generate signing certificate: rejected: Subject Name Not Matched DNQUALIFIER=12345,CN=pre CA

Actual behavior

Got an IPA error.

Expected behavior

A New CA with subject DN=DNQUALIFIER=12345,CN=pre CA

Capture.PNG


There is a naming constraint in the CA profile of:

policyset.caCertSet.1.constraint.params.pattern=CN=.*

So simply swap the order of the RDN values and it will work.

There is a naming constraint in the CA profile of:

policyset.caCertSet.1.constraint.params.pattern=CN=.*

So simply swap the order of the RDN values and it will work.

Thanks. I found three CA cfg Which one?

var/lib/pki/pki-tomcat/ca/profiles/ca/caCACert.cfg:16:policyset.caCertSet.1.constraint.params.pattern=CN=.*

var/lib/pki/pki-tomcat/ca/profiles/ca/caCMCcaCert.cfg:16:policyset.caCertSet.1.constraint.params.pattern=CN=.*

var/lib/pki/pki-tomcat/ca/profiles/ca/caInstallCACert.cfg:17:policyset.caCertSet.1.constraint.params.pattern=CN=.*

Should I leave this parameter blank as?

please let me know

Look in the pki debug log and you'll see what profile is being used;

INFO: CertProcessor: Submitting certificate request to ...

If you have specific profile questions you'd be better off engaging the dogtag pki team directly.

Metadata Update from @rcritten:
- Issue close_status updated to: wontfix
- Issue status updated to: Closed (was: Open)

You can change the pattern to .*. I haven't tested what would happen if you leave the pattern blank.

The actual profile is caCACert. In FreeIPA deployments, it is stored in the LDAP object cn=caCACert,ou=certificateProfiles,ou=ca,o=ipaca. You cannot edit it via the ipa command. Instead, you can use the pki ca-profile-edit command (you can use the IPA RA Agent certificate to authenticate), or else ldapmodify the object directly.

You can change the pattern to .*. I haven't tested what would happen if you leave the pattern blank.

The actual profile is caCACert. In FreeIPA deployments, it is stored in the LDAP object cn=caCACert,ou=certificateProfiles,ou=ca,o=ipaca. You cannot edit it via the ipa command. Instead, you can use the pki ca-profile-edit command (you can use the IPA RA Agent certificate to authenticate), or else ldapmodify the object directly.

Thanks.
I'm using a containerized FreeIPA CA. I can manually change it with vim. After changing the caCAcert.cfg file, Do I need to do something else in order to make the change take effect?

@ogonzales as mentioned above, the actual profile config is stored in LDAP. That is the object that needs to be modified - not a flat file on disk. You can use the pki ca-profile-edit command (will invoke an editor) or ldapmodify (the certProfileConfig attribute is base-64 encoded, so you must decode, edit, and re-encode it).

Got it. Thanks!

Metadata