Bug 1011217 - OpenLDAP ignores TLS options
Summary: OpenLDAP ignores TLS options
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: openldap
Version: 6.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jan Synacek
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-23 19:51 UTC by Daniel Sands
Modified: 2013-09-24 12:43 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-24 12:43:14 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 760856 0 medium CLOSED nss-pam-ldapd not work with certificates in nss db 2021-02-22 00:41:40 UTC

Description Daniel Sands 2013-09-23 19:51:26 UTC
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

Comment 1 Daniel Sands 2013-09-23 22:13:51 UTC
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.

Comment 2 Jan Synacek 2013-09-24 12:43:14 UTC
Not a bug. See http://www.openldap.org/its/index.cgi?findid=4726.

If you believe the documentation should be updated, please file an RFE.


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