RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1325798 - pki-tools in RHEL7 repo doesn't allow RHCS cert signing
Summary: pki-tools in RHEL7 repo doesn't allow RHCS cert signing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pki-core
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: 7.3
Assignee: Matthew Harmsen
QA Contact: Asha Akkiangady
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-11 08:45 UTC by Jakub Samuel Paulovic
Modified: 2016-11-04 05:23 UTC (History)
6 users (show)

Fixed In Version: pki-core-10.3.1-1.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 05:23:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Xml_files (20.00 KB, application/x-tar)
2016-07-21 11:43 UTC, Geetika Kapoor
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2396 0 normal SHIPPED_LIVE pki-core bug fix and enhancement update 2016-11-03 13:55:03 UTC

Description Jakub Samuel Paulovic 2016-04-11 08:45:42 UTC
Description of problem:
The package pki-tools available from RHEL7 repo rhel-7-server-rhcmsys-9-rpms is only in version 10.2.6-8.el7pki, but it doesn't work because it does not support option to authenticate (--username and --password) in the cert-request-submit module, so the server replies with Unauthorized status and fails. On Fedora 23 with version 10.2.6-16.fc23 it works fine.
The solution would be to make a newer version of pki-tools available in RHEL7 repos. 
Thanks.

Version-Release number of selected component (if applicable):
pki-tools-10.2.6-8.el7pki.x86_64

How reproducible:
Run 'pki -v -C ~/.pki.password -U server_URL cert-request-submit user.xml  --username $USERNAME --password' where user.xml is the certificate request to be signed.

Steps to Reproduce:
1. Run 'pki -v -C ~/.pki.password -U server_URL cert-request-submit user.xml  --username $USERNAME --password'


Actual results:

Get an error response from server:

Server URI: server_URI
Client security database: /home/username/.dogtag/nssdb
Message format: null
Command: cert-request-submit request.xml --username username --password
Initializing client security database
Logging into security token
Module: cert
Module: request-submit
Error: Unrecognized option: --username
usage: cert-request-submit <filename> [OPTIONS...]
    --help   Show help options

Expected results:
Get this status: 
-----------------------------
Submitted certificate request
-----------------------------
and then receive a confirmation email.

Additional info:

Comment 4 Matthew Harmsen 2016-04-20 21:36:48 UTC
Changed back to POST per CS Bug Triage of 04/19/2016.

Comment 6 Geetika Kapoor 2016-07-21 11:37:01 UTC
Setup:
------

1. Create template of existing profile. 
pki -v  -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 20080 cert-request-profile-show caDirUserCert --output user1.xml
pki -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 20080 cert-request-profile-show caUserCert --output user.xml

2. Create key/csr request.

openssl genrsa 4096 > test.key
openssl req -new -key test.key -out test.csr

3. Include below mentioned fiels in the templates of profile i.e user.xml and user1.xml (Attached copy of both xml for future use)

user.xml:

cert_request_type = pkcs10
cert_request = your copied CSR output
subject =

User1.xml:

        cert_request_type = pkcs10
        cert_request = your copied CSR output
        sn_cert_name = the custom name that got you into this mess to begin with

4. Create ldap users so that it can be verified using username/password.
dn: uid=ldapuser2,ou=people,dc=example,dc=org
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
uid:ldapuser2
cn: Test User
sn: User
givenName: Test
userPassword: Secret123%_test

5. Edit ca CS.cfg. Stop the CA seive first using systemctl stop pki-tomcatd

-- Edit below entries in CS.cfg

auths.instance.UserDirEnrollment.ldap.basedn=dc=example,dc=org
auths.instance.UserDirEnrollment.ldap.ldapauth.authtype=BasicAuth
auths.instance.UserDirEnrollment.ldap.ldapauth.bindDN=cn=Directory Manager
auths.instance.UserDirEnrollment.ldap.ldapauth.bindPWPrompt=internaldb
auths.instance.UserDirEnrollment.ldap.ldapconn.host=pki1.example.com
auths.instance.UserDirEnrollment.ldap.ldapconn.port=3389
auths.instance.UserDirEnrollment.ldap.ldapconn.secureConn=false
auths.instance.UserDirEnrollment.pluginName=UidPwdDirAuth

-- start CA service .systemctl start  pki-tomcatd


6. output should say :

Valid Ldap entry:
-----------------
pki  -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 20080 cert-request-submit user1.xml --username ldapuser2 --password Secret123_test
Password: 
-----------------------------
Submitted certificate request
-----------------------------
  Request ID: 79
  Type: enrollment
  Request Status: complete
  Operation Result: success
  Certificate ID: 0x43

Test Case 1: For valid ldapuser entry
-------------
[root@pki1 test_dir]# pki  -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 20080 cert-request-submit user1.xml --username ldapuser2 --password Secret123_test
Password: 
-----------------------------
Submitted certificate request
-----------------------------
  Request ID: 79
  Type: enrollment
  Request Status: complete
  Operation Result: success
  Certificate ID: 0x43


Test Case 2: Invalid ldap user entry
------------
[root@pki1 test_dir]# pki  -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 20080 cert-request-submit user1.xml --username ldapuser2 --password Secret123_testt
Password: 
UnauthorizedException: Invalid Credential

Test Case 3: Remove LDAP setting added in step 5. Make sure no more authentication happens now.
-----------

pki  -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 20080 cert-request-submit user1.xml --username ldapuser2 --password Secret123_testt
Password: 
PKIException: Property auths.instance.UserDirEnrollment.ldap.ldapconn.host missing value

Test Case 4: Lif LDAP instance is not reachable/down
------------

pki  -d /opt/rhqa_pki/certdb -c Secret123 -h pki1.example.com -p 20080 cert-request-submit user1.xml --username ldapuser2 --password Secret123_testt
Password: 
PKIException: Could not connect to LDAP server host pki1.example.com port 389 Error netscape.ldap.LDAPException: failed to connect to server ldap://pki1.example.com:389 (91)


Reference:

https://mojo.redhat.com/docs/DOC-959077
http://pki.fedoraproject.org/wiki/Directory-Authenticated_Profiles

Comment 7 Geetika Kapoor 2016-07-21 11:43:19 UTC
Created attachment 1182446 [details]
Xml_files

Comment 9 errata-xmlrpc 2016-11-04 05:23:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2396.html


Note You need to log in before you can comment on or make changes to this bug.