Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
When ldap_set_option is used to set the TLS parameters such as CACERTDIR, CERTFILE, and KEYFILE, the settings are unused. This is because in tls2.c, alloc_handle is called with a null context. In case of null context, alloc_handle will use the global options to initialize the TLS parameters -- the LDAP handle's options are not available.
OpenLDAP on RHEL6 seems to be using Mozilla NSS, and its deferred initializer function is called only on this initial alloc_handle. Therefore it only loads certificate authorities from the global default location and does not define a client certificate or key at all.
Setting these values through the environment is the only workaround.
Version-Release number of selected component (if applicable):
Current as of bug report (2.4.23-32)
How reproducible:
Always
Steps to Reproduce:
1. Set the TLS options programmatically through ldap_set_option
2. Attempt to connect to a SSL LDAP server
Actual results:
Failure to exchange proper certificates. If the server certificate is self-signed and not stored in the default CA certificates location, server certificate verification will fail.
Expected results:
Proper SSL negotiation with the expected certificate and CA trusts.
Additional info:
This may be the cause of Bug 760856
Further trawling through the code shows that if ldap_set_option is called with LDAP_OPT_X_TLS_NEWCTX after setting the other TLS values, it will finally take effect. The documentation does not say this, though. So either it's an unintended workaround, or the documentation should be improved to say that this step is necessary.