#9735 Installing IPA with KRA creates invalid ca_admin.cert format
Closed: fixed by rcritten. Opened by edewata.

Issue

After installing IPA with KRA the /root/.dogtag/pki-tomcat/ca_admin.cert contains a Base64 cert instead of PEM or DER cert so it cannot be parsed by OpenSSL.

Steps to Reproduce

  1. Install IPA server with CA
  2. Check /root/.dogtag/pki-tomcat/ca_admin.cert
  3. Install KRA
  4. Check /root/.dogtag/pki-tomcat/ca_admin.cert again

Actual behavior

In step 2 the ca_admin.cert contains a valid PEM cert:
https://github.com/edewata/pki/actions/runs/12957621930/job/36146535330#step:7:24

In step 4 the file now contains Base64 cert:
https://github.com/edewata/pki/actions/runs/12957621930/job/36146535330#step:11:15

Expected behavior

In step 4 the file should contain a valid PEM or DER cert.

Version/Release/Distribution

freeipa-server-4.13.0.dev202501211625+git-0.fc41

Additional info:

The Base64 cert is apparently created by this code:
https://github.com/freeipa/freeipa/blob/master/ipaserver/install/krainstance.py#L235

It's possible that when the code was written 8 years ago PKI was also using Base64 format:
https://github.com/freeipa/freeipa/commit/5a44ca638310913ab6b0c239374f4b0ddeeedeb3

However, this file resides in PKI-owned folder and PKI is now creating the file with PEM format and PKI code might assume/enforce that the file (if exists) will have a valid cert format, so if IPA is creating this file it should be using a valid cert format as well.

Alternatively, IPA probably could reuse the original ca_admin.cert created when installing IPA with CA instead of creating a new one.


IPA doesn't re-use an existing ca_admin.cert because it could be expired. I guess it was just simpler to refresh it than check it. It should be straightforward to use PEM instead.

Metadata Update from @rcritten:
- Issue assigned to rcritten

master:

  • 66335486954137aa998d5e2ba939e67a5d82f464 Write out the PKI admin certificate as a PEM file

ipa-4-12:

  • d070a9abc5029a81a6eda257f1c6ad59e6b9ae60 Write out the PKI admin certificate as a PEM file

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

Thanks!

Metadata