<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Aug 3, 2016 at 12:49 AM, Florence Blanc-Renaud <span dir="ltr"><<a href="mailto:flo@redhat.com" target="_blank">flo@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 08/02/2016 04:52 AM, Richard Harmonson wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">
On Mon, Aug 1, 2016 at 10:15 AM, Petr Vobornik <<a href="mailto:pvoborni@redhat.com" target="_blank">pvoborni@redhat.com</a><br></span><div><div class="gmail-h5">
<mailto:<a href="mailto:pvoborni@redhat.com" target="_blank">pvoborni@redhat.com</a>>> wrote:<br>
<br>
    On 07/31/2016 07:45 AM, Richard Harmonson wrote:<br>
    > I having challenges resuming ipa-server-install --external-ca. I<br>
    am reasonably<br>
    > confident I am not providing the right certificate and/or format<br>
    from my<br>
    > off-line root CA using 389 and Dogtag.<br>
    ><br>
    > Does anyone have instructions on how to accomplish the task of<br>
    exporting the<br>
    > correct certificates in the expected format?<br>
    ><br>
    > Thank you.<br>
    ><br>
<br>
    The IPA procedure with prerequisites is described at<br>
    <a href="https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Linux_Domain_Identity_Authentication_and_Policy_Guide/install-server.html#install-server-external-ca" rel="noreferrer" target="_blank">https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Linux_Domain_Identity_Authentication_and_Policy_Guide/install-server.html#install-server-external-ca</a><br>
<br>
    Or are you rather asking for specific PKI instructions?<br>
<br>
    e.g.<br>
    *<br>
    <a href="http://pki.fedoraproject.org/wiki/PKI_Certificate_CLI#Submitting_a_Certificate_Request" rel="noreferrer" target="_blank">http://pki.fedoraproject.org/wiki/PKI_Certificate_CLI#Submitting_a_Certificate_Request</a><br>
<br>
    *<br>
    <a href="http://pki.fedoraproject.org/wiki/CA_Certificate_Profiles#caCACert:_Manual_Certificate_Manager_Signing_Certificate_Enrollment" rel="noreferrer" target="_blank">http://pki.fedoraproject.org/wiki/CA_Certificate_Profiles#caCACert:_Manual_Certificate_Manager_Signing_Certificate_Enrollment</a><br>
    --<br>
    Petr Vobornik<br>
<br>
<br>
I read the suggested document, previously, but its an excellent shared<br>
reference for this discussion.<br>
<br>
I have successfully submitted and approved the csr. Dogtag provides a<br>
web UI which provides a Base 64 encoded certificate or Base 64 encoded<br>
certificate with CA certificate chain in pkcs7 format.<br>
<br>
For the servercert2010601.pem (the signed CSR request signing CA<br>
certificate 0x9) referenced in the article, do I  copy and paste<br>
(-----BEGIN .. END-----) the base 64 (not pkcs7) to a file using *.pem<br>
then submit using one of the two --external-cert-file?<br>
<br>
For the cacert.pem (the Root CA signing certificate 0x1) referenced in<br>
the article, do I copy and paste the base 64 with ca in pkcs7 format to<br>
a file using *.pkcs7 (or pem or does it matter?) then submit using the<br>
second --external-cert-file?<br>
<br>
Your guidance is much appreciated.<br>
<br>
<br>
</div></div></blockquote>
Hi Richard,<br>
<br>
I tested the following steps to install FreeIPA with a certificate signed by an external Dogtag instance:<br>
<br>
1- IPA installation on host ipaserver with:<br>
ipaserver$ ipa-server-install [options] --external-ca<br>
<br>
This step produces the Certificate Signing Request /root/ipa.csr that must be provided to the Dogtag server.<br>
<br>
2- On the Dogtag machine, configure Dogtag client authentication (to be able to use the command-line):<br>
<br>
dogtagsrv$ pki -c password client-init<br>
<br>
This step creates a NSSDB in ~/.dogtag/nssdb where the certificates for client->dogtag server authentication will be stored.<br>
<br>
dogtagsrv$ pk12util -i /root/.dogtag/pki-tomcat/ca_admin_cert.p12 -d /root/.dogtag/nssdb/<br>
<br>
This step imports the caadmin certificate that was created during Dogtag installation into the client NSSDB. The client will be able to authenticate as "caadmin" when using Dogtag CLI. Please note the certicate nickname that can be found using<br>
<br>
dogtagsrv$ certutil -L -d ~/.dogtag/nssdb/<br>
[...]<br>
PKI Administrator for <security domain>         u,u,u<br>
<br>
3- On the Dogtag machine, submit the CSR and approve:<br>
dogtagsrv$ pki ca-cert-request-submit --profile caCACert --request-type pkcs10 --csr-file  /path/to/ipa.csr<br>
<br>
This step submits the csr to Dogtag, using the caCACert profile in order to produce a Certificate that can be used for a Certificate Authority. Note the Request ID in the output as it will be used in the next command to approve the CSR and produce the cert:<br>
<br>
dogtagsrv$ pki -c password -d ~/.dogtag/nssdb/ -n "PKI Administrator for <security domain>"  cert-request-review <id> --action approve<br>
<br>
4- On the Dogtag machine, export the certificate and the dogtag CA cert:<br>
<br>
dogtagsrv$ pki -c password -d ~/.dogtag/nssdb/ -n "PKI Administrator for <security domain>"  cert-show 7 --encoded --output  ipa.cert<br>
dogtagsrv$ pki ca-cert-show 1 --encoded --output dogtagca.cert<br>
<br>
5- Resume ipa server installation with<br>
<br>
ipaserver$ ipa-server-install --external-cert-file=ipa.cert --external-cert-file=dogtagca.cert<br>
<br>
With those steps, I was able to install FreeIPA server with a 3rd-party signed Certificate Authority. Please let me known if you have issues with those instructions,<br>
<br>
Flo.<br>
</blockquote></div><br></div><div class="gmail_extra">Awesome!<br><br></div><div class="gmail_extra">Flo, your instructions were perfect! I exported the certs and during the ipa-server-install I see the certs being displayed on the screen then "Process finished, return code=0, so they are accepted on resuming the installation. The install fails with a LDAP error but I believe it to be unrelated to the exported certs. May be a result of my earlier thrashing?<br><br></div><div class="gmail_extra">I will recover from a snapshot and begin again. If problems persist, I will send another request for help for it is probably unrelated to the certificates.<br><br>You got me one step closer. Thank you!<br><br></div><div class="gmail_extra">Debug shows:<br><br># pa-server-install --external-cert-file=ipa.cert --external-cert-file=dogtagca.cert<br>..<br>ipa         : DEBUG    Starting external process<br>ipa         : DEBUG    args=/usr/sbin/pkispawn -s CA -f /tmp/tmpDVXaWo<br>ipa         : DEBUG    Process finished, <b>return code=1</b><br>ipa         : DEBUG    stdout=Log file: /var/log/pki/pki-ca-spawn.20160803103307.log<br>Loading deployment configuration from /tmp/tmpDVXaWo.<br><b>ERROR:  Unable to access directory server: Can't contact LDAP server</b><br><br>ipa         : DEBUG    stderr=<br>ipa.ipaserver.install.cainstance.CAInstance: CRITICAL Failed to configure CA instance: Command '/usr/sbin/pkispawn -s CA -f /tmp/tmpDVXaWo' returned non-zero exit status 1<br>ipa.ipaserver.install.cainstance.CAInstance: CRITICAL See the installation logs and the following files/directories for more information:<br>ipa.ipaserver.install.cainstance.CAInstance: CRITICAL   /var/log/pki/pki-tomcat<br>ipa         : DEBUG    Traceback (most recent call last):<br>  File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 447, in start_creation<br>    run_step(full_msg, method)<br>  File "/usr/lib/python2.7/site-packages/ipaserver/install/service.py", line 437, in run_step<br>    method()<br>  File "/usr/lib/python2.7/site-packages/ipaserver/install/cainstance.py", line 579, in __spawn_instance<br>    DogtagInstance.spawn_instance(self, cfg_file)<br>  File "/usr/lib/python2.7/site-packages/ipaserver/install/dogtaginstance.py", line 181, in spawn_instance<br>    self.handle_setup_error(e)<br>  File "/usr/lib/python2.7/site-packages/ipaserver/install/dogtaginstance.py", line 421, in handle_setup_error<br>    raise RuntimeError("%s configuration failed." % self.subsystem)<br>RuntimeError: CA configuration failed.<br>..<br></div><div class="gmail_extra"><br><br></div></div>