Dogtag ReST Interface Enrollment Java Null Pointer Exception
Hi, I have encountered a Java null pointer exception when I try to do an an enrollment using Dogtag 10.2.4's ReST interface. I receive the following response back from Dogtag when I POST to the resource ending in /ca/rest/certrequests. <?xml version="1.0" encoding="UTF-8" standalone="yes"?><PKIException><Attributes/><ClassName>com.netscape.certsrv.base.PKIException</ClassName><Code>500</Code><Message>java.lang.NullPointerException</Message></PKIException>2015/ I understand that there is a new ReST interface that was introduced to Dogtag where enrollment requests should be posted to the resource ending in /pki/request. However, when I do that, I receive a 404 page back in response. I am using Fedora 22 Server 32 bit with just the 389 directory service installed alongside Dogtag 10.2.4. Any guidance would be appreciated. Thanks, Peter
Hi: Would it be possible to post the exact or similar command line you were trying? ----- Original Message -----
From: "Peter P." <p.pan48711@gmail.com> To: pki-users@redhat.com Sent: Tuesday, June 23, 2015 12:23:27 PM Subject: [Pki-users] Dogtag ReST Interface Enrollment Java Null Pointer Exception
Hi,
I have encountered a Java null pointer exception when I try to do an an enrollment using Dogtag 10.2.4's ReST interface. I receive the following response back from Dogtag when I POST to the resource ending in /ca/rest/certrequests.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><PKIException><Attributes/><ClassName>com.netscape.certsrv.base.PKIException</ClassName><Code>500</Code><Message>java.lang.NullPointerException</Message></PKIException>2015/
I understand that there is a new ReST interface that was introduced to Dogtag where enrollment requests should be posted to the resource ending in /pki/request. However, when I do that, I receive a 404 page back in response.
I am using Fedora 22 Server 32 bit with just the 389 directory service installed alongside Dogtag 10.2.4.
Any guidance would be appreciated.
Thanks,
Peter
_______________________________________________ Pki-users mailing list Pki-users@redhat.com https://www.redhat.com/mailman/listinfo/pki-users
Hi John, Thank you for helping me with this issue! I build an XML response using snprintf shown below that I post using libcURL with this URL https://mydogtagserver:8443/ca/rest/certrequests snprintf(payload, MAX_CERT_LEN, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><CertEnrollmentRequest>" " <profileId>%s</profileId> <isRenewal>false</isRenewal> <xmlOutput>false</xmlOutput>" " <Input> <InputAttrs> <InputAttr name=\"cert_request_type\">pkcs10</InputAttr>\t" " <InputAttr name=\"cert_request\">%s</InputAttr> </InputAttrs> </Input></CertEnrollmentRequest>", profile_id, pkcs10_csr); profile_id is the profile I wish to enroll with and pkcs10_csr is my CSR. Let me know if you need any more information from me. Thank you, Peter On Tue, Jun 23, 2015 at 4:47 PM, John Magne <jmagne@redhat.com> wrote:
Hi:
Would it be possible to post the exact or similar command line you were trying?
----- Original Message -----
From: "Peter P." <p.pan48711@gmail.com> To: pki-users@redhat.com Sent: Tuesday, June 23, 2015 12:23:27 PM Subject: [Pki-users] Dogtag ReST Interface Enrollment Java Null Pointer Exception
Hi,
I have encountered a Java null pointer exception when I try to do an an enrollment using Dogtag 10.2.4's ReST interface. I receive the following response back from Dogtag when I POST to the resource ending in /ca/rest/certrequests.
<?xml version="1.0" encoding="UTF-8"
standalone="yes"?><PKIException><Attributes/><ClassName>com.netscape.certsrv.base.PKIException</ClassName><Code>500</Code><Message>java.lang.NullPointerException</Message></PKIException>2015/
I understand that there is a new ReST interface that was introduced to
Dogtag
where enrollment requests should be posted to the resource ending in /pki/request. However, when I do that, I receive a 404 page back in response.
I am using Fedora 22 Server 32 bit with just the 389 directory service installed alongside Dogtag 10.2.4.
Any guidance would be appreciated.
Thanks,
Peter
_______________________________________________ Pki-users mailing list Pki-users@redhat.com https://www.redhat.com/mailman/listinfo/pki-users
On 6/23/2015 5:33 PM, Peter P. wrote:
Hi John,
Thank you for helping me with this issue! I build an XML response using snprintf shown below that I post using libcURL with this URL https://mydogtagserver:8443/ca/rest/certrequests
snprintf(payload, MAX_CERT_LEN, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><CertEnrollmentRequest>" " <profileId>%s</profileId> <isRenewal>false</isRenewal> <xmlOutput>false</xmlOutput>" " <Input> <InputAttrs> <InputAttr name=\"cert_request_type\">pkcs10</InputAttr>\t" " <InputAttr name=\"cert_request\">%s</InputAttr> </InputAttrs> </Input></CertEnrollmentRequest>", profile_id, pkcs10_csr);
profile_id is the profile I wish to enroll with and pkcs10_csr is my CSR.
Let me know if you need any more information from me.
Thank you,
Peter
Hi Peter, The XML request format above seems to be outdated. Please take a look at the following page: http://pki.fedoraproject.org/wiki/User_Certificate_Setup You can also run the CLI and see the actual XML request sent by the CLI: $ pki -c Secret123 client-init $ mkdir tmp $ pki -v --output tmp -c Secret123 client-cert-request uid=testuser $ cat tmp/http-request-2 -- Endi S. Dewata
Hi Endi, Is there more documentation for the whole XML schema described on that page? I believe for my use case I will need to adjust some of the tags present in my XML posts to Dogtag. Thank you, Peter On Wed, Jun 24, 2015 at 2:09 PM, Endi Sukma Dewata <edewata@redhat.com> wrote:
On 6/23/2015 5:33 PM, Peter P. wrote:
Hi John,
Thank you for helping me with this issue! I build an XML response using snprintf shown below that I post using libcURL with this URL https://mydogtagserver:8443/ca/rest/certrequests
snprintf(payload, MAX_CERT_LEN, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><CertEnrollmentRequest>" " <profileId>%s</profileId> <isRenewal>false</isRenewal> <xmlOutput>false</xmlOutput>" " <Input> <InputAttrs> <InputAttr name=\"cert_request_type\">pkcs10</InputAttr>\t" " <InputAttr name=\"cert_request\">%s</InputAttr> </InputAttrs> </Input></CertEnrollmentRequest>", profile_id, pkcs10_csr);
profile_id is the profile I wish to enroll with and pkcs10_csr is my CSR.
Let me know if you need any more information from me.
Thank you,
Peter
Hi Peter,
The XML request format above seems to be outdated. Please take a look at the following page: http://pki.fedoraproject.org/wiki/User_Certificate_Setup
You can also run the CLI and see the actual XML request sent by the CLI: $ pki -c Secret123 client-init $ mkdir tmp $ pki -v --output tmp -c Secret123 client-cert-request uid=testuser $ cat tmp/http-request-2
-- Endi S. Dewata
On 6/24/2015 1:31 PM, Peter P. wrote:
Hi Endi,
Is there more documentation for the whole XML schema described on that page? I believe for my use case I will need to adjust some of the tags present in my XML posts to Dogtag.
Thank you,
Peter
Right now we don't have XML schema documentation yet because the XML is generated automatically from a POJO. So for now you'd have to look at the code, or capture the CLI output like I showed you earlier, to figure out the XML format. Please feel free to file a ticket for this. Thanks! -- Endi S. Dewata
Hi, I was able to resolve my issue using the information Endi provided. I have included the CLI output below with the CSR redacted. Thanks again, Peter <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <CertEnrollmentRequest> <ProfileID>caUserCert</ProfileID> <Renewal>false</Renewal> <SerialNumber></SerialNumber> <RemoteHost></RemoteHost> <RemoteAddress></RemoteAddress> <Input id="i1"> <ClassID>keyGenInputImpl</ClassID> <Name>Key Generation</Name> <Attribute name="cert_request_type"> <Value>pkcs10</Value> <Descriptor> <Syntax>keygen_request_type</Syntax> <Description>Key Generation Request Type</Description> </Descriptor> </Attribute> <Attribute name="cert_request"> <Value>CSR GOES HERE </Value> <Descriptor> <Syntax>keygen_request</Syntax> <Description>Key Generation Request</Description> </Descriptor> </Attribute> </Input> <Input id="i2"> <ClassID>subjectNameInputImpl</ClassID> <Name>Subject Name</Name> <Attribute name="sn_uid"> <Value>testuser</Value> <Descriptor> <Syntax>string</Syntax> <Description>UID</Description> </Descriptor> </Attribute> <Attribute name="sn_e"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Email</Description> </Descriptor> </Attribute> <Attribute name="sn_cn"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Common Name</Description> </Descriptor> </Attribute> <Attribute name="sn_ou3"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Organizational Unit 3</Description> </Descriptor> </Attribute> <Attribute name="sn_ou2"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Organizational Unit 2</Description> </Descriptor> </Attribute> <Attribute name="sn_ou1"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Organizational Unit 1</Description> </Descriptor> </Attribute> <Attribute name="sn_ou"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Organizational Unit</Description> </Descriptor> </Attribute> <Attribute name="sn_o"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Organization</Description> </Descriptor> </Attribute> <Attribute name="sn_c"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Country</Description> </Descriptor> </Attribute> </Input> <Input id="i3"> <ClassID>submitterInfoInputImpl</ClassID> <Name>Requestor Information</Name> <Attribute name="requestor_name"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Requestor Name</Description> </Descriptor> </Attribute> <Attribute name="requestor_email"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Requestor Email</Description> </Descriptor> </Attribute> <Attribute name="requestor_phone"> <Value></Value> <Descriptor> <Syntax>string</Syntax> <Description>Requestor Phone</Description> </Descriptor> </Attribute> </Input> </CertEnrollmentRequest> On Wed, Jun 24, 2015 at 2:44 PM, Endi Sukma Dewata <edewata@redhat.com> wrote:
On 6/24/2015 1:31 PM, Peter P. wrote:
Hi Endi,
Is there more documentation for the whole XML schema described on that page? I believe for my use case I will need to adjust some of the tags present in my XML posts to Dogtag.
Thank you,
Peter
Right now we don't have XML schema documentation yet because the XML is generated automatically from a POJO. So for now you'd have to look at the code, or capture the CLI output like I showed you earlier, to figure out the XML format. Please feel free to file a ticket for this. Thanks!
-- Endi S. Dewata
participants (3)
-
Endi Sukma Dewata -
John Magne -
Peter P.