Bug 1048474 - TLS does not work for ldap, incorrect TLS & Debug attribute setting in rlm_ldap
Summary: TLS does not work for ldap, incorrect TLS & Debug attribute setting in rlm_ldap
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: freeradius
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: John Dennis
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1048475
TreeView+ depends on / blocked
 
Reported: 2014-01-04 13:55 UTC by John Dennis
Modified: 2014-01-28 04:36 UTC (History)
2 users (show)

Fixed In Version: freeradius-3.0.1-2.fc20
Clone Of:
: 1048475 (view as bug list)
Environment:
Last Closed: 2014-01-15 00:23:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description John Dennis 2014-01-04 13:55:11 UTC
rlm_ldap cannot successfully establish TLS connections with an OpenLDAP server. This is because the TLS connection attributes are not set when the OpenLDAP client library tries to make a connection. The failing connection causes the radius server to fail to initialize and it immediately exits.

The problem is related to use of LDAP_OPT_X_TLS_NEWCTX to establish a per connection TLS context. Apparently LDAP_OPT_X_TLS_NEWCTX has to be called *after* calling ldap_set_option() to set the TLS attributes, if it's called prior to setting the attributes (as is the current code) then the TLS attributes are not copied into the new TLS context.

Not sure, but this might only be a problem for the MozNSS module as opposed to the OpenSSL module (OpenLDAP can be built with different crypto implementations). Currently Red Hat is the only distribution that deploys OpenLDAP with MozNSS which might explain why this problem was not seen upstream. I want to investigate further on this.

Moving LDAP_OPT_X_TLS_NEWCTX to after setting the TLS attributes fixes the connection failures.

During debugging it was also discovered that the way rlm_ldap sets the LDAP debug flag is also incorrect. The debug flag needs to be set on the global context, not the per connection context. As currently implemented one cannot get the ldap library to emit debug information, this also needs fixing.

Comment 1 Fedora Update System 2014-01-15 00:32:14 UTC
freeradius-3.0.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/freeradius-3.0.1-1.fc20

Comment 2 Fedora Update System 2014-01-23 17:22:12 UTC
freeradius-3.0.1-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/freeradius-3.0.1-2.fc20

Comment 3 Fedora Update System 2014-01-28 04:36:30 UTC
freeradius-3.0.1-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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