Test Day:2010-10-14 OpenLDAP/NSS

What to test?
Today's installment of Fedora Test Day will focus on OpenLDAP with TLS encryption. OpenLDAP in Fedora 14 uses Mozilla NSS instead of OpenSSL crypto backend. This change should have no effect for users, but to be sure we want to test OpenLDAP server and as many programs using OpenLDAP libraries (libldap) as possible.

Who's available
The following cast of characters will be available testing, workarounds, bug fixes, and general discussion ...
 * Development - Jan Zeleny (jzeleny), Jan Vcelak (jvcelak), Rich Megginson (rmeggins)
 * Quality Assurance - Ondrej Moris (omoris)

Prerequisite for Test Day

 * 1) Fedora 14 (or Rawhide) system
 * 2)   and   packages
 * 3) optionally for testing server:   package
 * 4) at least one application from package list below

Priority 6 (the least important)


Update your machine
If you're running Fedora 14, make sure you have all the current updates for it installed, using the update manager.

Kickstart / Live DVD
We recommend the testing to be done in virtual machine, using a Fedora 14 network install as installation medium. Boot and installation images are available (i386, x86_64)

If you want to download Live medium, we have two LiveCDs available for you here. These images contain LiveCDs with shortcuts to IRC and this wiki page. They also have all Priority 1 programs pre-installed in case you want to test one of them.

Available testing servers
Download OpenLDAP Testday CA certificate (PEM format). Certificates of testing servers are signed by this CA.

Accessing our servers

 * You can use anonymous bind for read only access.
 * For read-write access use bind name cn=Tester,dc=silver,dc=testday and password openldap. Subtree ou=free,dc=base,dc=testday is ready for your experiments. Please create some organization unit with your name under it, not to conflict with other testers. (Don't forgot to replace dc=silver correctly for other servers.)

(read-write access is now set up for openldap02 - use the cn=Tester user)

How to test?
Choose one of applications in the list above and mark it on this page by adding your name into "Taken by" column. Perform some testing. Below is a table of features what might be tested. The table lists common OpenLDAP based applications and the TLS options used. The table lists some features which are supported by  file. If your application uses OpenLDAP and is able to configure it to use TLS/SSL, you will probably have similar configuration options.

You can use our prepared LDAP server for your testing.

OpenLDAP command line tools

 * Application:,  , et. al.
 * Default config file: ,
 * Manual page: ldap.conf
 * Step by step configuration

Use the -Z (prefer TLS) or -ZZ (require TLS) command line options to use StartTLS with ldap:// URIs.

OpenLDAP server

 * Default config file:
 * Manual page: slapd-config
 * Step by step configuration

Use the -H command line option to have slapd listen for LDAPS requests (e.g. slapd -H ldaps://hostname ....)

For OpenLDAP server, we also need to test server-to-server interactions that use TLS. For example, test replication from a server using Mozilla NSS to another server using OpenSSL using LDAPS or StartTLS. Try a back-ldap or back-meta configuration using TLS/SSL.

pam_ldap/nss_ldap

 * Default config file:
 * Manual page: nss_ldap

Finishing test
After you perform testing, it is important to report results. A special section Test Results is available. Here you should write: what program have you tested, what was tested (i.e. what tests were performed) and what was the result. After you fill this report, please add a mark into "Notes" column in package list:

In the latter two cases a description of what went wrong should be available in Test Results section below.

Libldap
There are more possibilities of configuring trusted CAs. The easiest way is probably using TLS_CACERTDIR directory ( in this example) with certificate files in PEM format.

You can do it your way - may the force be with you. Directory with MozNSS cert database, and one bundle CA file are supported as well.


 * 1) install OpenLDAP client tools to have some simple tool for your configuration testing:
 * 2) you need hash for each certificate, you can use   tool:
 * 3) * run:
 * 4) * you should get something like: 537ced62.0 => /path/to/cert.pem
 * 5) create symlink in CA certs directory:
 * 6) repeat previous steps for each CA you trust
 * 7) make sure, all certificates are readable for all users trough created symlinks
 * 8) update
 * 9) * add: TLS_CACERTDIR /etc/openldap/cacerts
 * 10) * optionally, you can set up default server (URI) and search base (BASE)
 * 1) * optionally, you can set up default server (URI) and search base (BASE)

If you have a lot of certificates, you can use  tool from openssl-perl package.

OpenLDAP server
Quick help:


 * 1) install OpenLDAP server:
 * 2) choose and set your server base DN, e.g. dc=copper,dc=testday
 * 3) generate admin (manager) user password hash:
 * 4) update /etc/openldap/slapd.d/cn=config/olcDatabase={1}bdb.ldif
 * 5) * olcSuffix: dc=copper,dc=testday
 * 6) * olcRootDN: cn=Manager,dc=copper,dc=testday
 * 7) * olcRootPW: 
 * 8) update /etc/openldap/slapd.d/cn=config/olcDatabase={2}monitor.ldif
 * 9) * olcAccess: {0}to * by dn.base="cn=manager,dc=copper,dc=testday" read  by * none
 * 10) start your server:
 * 11) try your serve functionality
 * 12) * you should get:
 * 13) create base nodes
 * 14) * download example root DN nodes (LDIF)
 * 15) * update DNs in that file
 * 16) * import that file into the database:
 * 17) install BDB configuration file
 * 18) restart your server:
 * 19) your server is now configured and running without TLS
 * 20) generate certificates for your server (if you don't have any), we offer you step by step guide
 * 21) update , add following options (customised):
 * 22) * olcTLSCACertificateFile: /etc/openldap/certs/cacert.pem
 * 23) * olcTLSCertificateFile: /etc/openldap/certs/server.pem
 * 24) * olcTLSCertificateKeyFile: /etc/openldap/certs/server.pem
 * 25) make your certificates readable for   user
 * 26) enable at least ldaps:// interface in  :
 * 27) * SLAPD_LDAP=yes (default)
 * 28) * SLAPD_LDAPS=yes
 * 29) * SLAPD_LDAPI=yes (optional)
 * 30) restart your server:
 * 31) your server is running with TLS support
 * 32) test that your configuration is working
 * 33) * without TLS: ldapsearch -x -H ldap://localhost -b "dc=copper,dc=testday"
 * 34) * with TLS: ldapsearch -x -H ldaps://localhost -b "dc=copper,dc=testday"
 * 1) * without TLS: ldapsearch -x -H ldap://localhost -b "dc=copper,dc=testday"
 * 2) * with TLS: ldapsearch -x -H ldaps://localhost -b "dc=copper,dc=testday"

Use your own CA
There are more possibilities. The easiest way is installing TinyCA GUI, which will handle everything you need. You need not perform this task on your testing system.


 * 1) install TinyCA:
 * 2) create new certification authority
 * 3) create new certificate request
 * 4) * select 'Requests' tab
 * 5) * right-click into the emtpy list of requests and select 'New Request'
 * 6) * use pre-filled values, set 'Common Name' to match your server hostname
 * 7) * set some pass-phrase (which will be removed anyway)
 * 8) * click 'OK'
 * 9) sign the certificate request
 * 10) * right-click on the certificate request and select 'Sign Request', 'Sign Request (Server)'
 * 11) * you will be prompted for CA password
 * 12) * signed certificate will appear under 'Certificates' tab
 * 13) export your key + certificate for server
 * 14) * open 'Keys' tab
 * 15) * right click on appropriate key and select 'Export'
 * 16) * select export location (file)
 * 17) * Export Format: PEM
 * 18) * Without Passphrase: Yes
 * 19) * Include Certificate (PEM): Yes
 * 20) * click 'Save', provide your certificate pass-phrase password
 * 21) export your CA certificate
 * 22) * open 'CA' tab
 * 23) * click on 'Export CA' icon in toolbar
 * 24) * set filename, select PEM format and click on 'Save'
 * 25) configure your server to use your key and certificate
 * 26) configure your server and any clients to use/accept your CA

Use our public sub CA with TinyCA
CA password is: openldap
 * 1) download public testday sub CA
 * 2) move the file into
 * 3) extract the file:
 * 4) CA is ready, use it in TinyCA
 * 1) you have to add this CA certificate onto server
 * 2) append it to your olcTLSCACertificateFile (really file, not option in config)
 * 3) or use olcTLSCACertificatePath instead of olcTLSCACertificateFile

Other ways

 * OpenLDAP TLS guide (can be used as well)

Test Results
After you are finished testing, please file a testing report below. The first report can be used as an example how it should look like. If you encounter any issue, please first consult it on IRC. If it will be verified as a bug, file a bugzilla against openldap component and add a note about it to your report.

Tested program: abcd-1.5-3-fc14.x86_64
 * tried against all referential servers
 * tried TLS connection with and without client certificate
 * all test were tun with option CDEF turned on
 * all test were running fine, except one
 * bug #123456 was filed
 * bug #123457 was filed

[omoris] Tested program: openldap-servers-2.4.22-7.fc14.i686 openldap-clients-2.4.22-7.fc14.i686
 * executed upstream self-test included in source rpm
 * all passed

[ksrot] Tested program: curl-7.21.0-5.fc14.x86_64 curl 'ldap://openldap03.fedoraproject.org/dc=gold,dc=testday??sub' curl --cacert /etc/testday/cacert.pem 'ldaps://openldap03.fedoraproject.org/dc=gold,dc=testday??sub' curl 'ldap://openldap01.fedoraproject.org/dc=silver,dc=testday??sub' curl --cacert /etc/testday/cacert.pem 'ldaps://openldap01.fedoraproject.org/dc=silver,dc=testday??sub'
 * tried the query LDAP database using following commands:
 * output looked fine

[jvcelak] Tested program: openldap-2.4.23-1.fc15.x86_64 openldap-2.4.21-10.fc13.x86_64
 * reported bug #641946 (slapd init script gets stuck in an infinite loop)
 * OK: CA signed certificates (now used on silver and bronze)
 * OK: sub-CA signed certificates (now used on gold)
 * OK: referral chasing with TLS (tested including loops)
 * OK: Ldap backend with TLS, works as a proxy (tested including loops)
 * OK: self-signed certificates
 * OK: delta-syncrepl with TLS
 * verification with OpenSSL fails when connecting to localhost (host name doesn't match)
 * verification with MozNSS works well when connecting to localhost or hostname
 * verification with MozNSS fails when using certificate and hostname doesn't match
 * MozNSS error messages often miss explanation (like -8172 Unknown error)

[mvadkert] Tested program: openssh-5.5p1-21.fc14.2.x86_64 root@freedom openldap]# /usr/libexec/openssh/ssh-ldap-helper -vvv -f /etc/openldap/ldap.conf -s user2 debug1: Reading configuration data /etc/openldap/ldap.conf debug3: === Configuration === debug3: URI ldaps://openldap03.fedoraproject.org debug3: Host openldap03.fedoraproject.org debug3: Port 636 debug3: SSL Yes debug3: Ldap_Version 3 debug3: Base ou=omoris,ou=free,dc=gold,dc=testday debug3: BindDN cn=Tester,dc=gold,dc=testday debug3: BindPW openldap debug3: Scope Sub [snip] debug1: LDAP do connect debug3: Set TLS CA cert dir /etc/openldap/cacerts debug3: Set TLS check peer to 1 debug3: LDAP initialize ldaps://openldap03.fedoraproject.org [snip] debug3: LDAP search scope = 2 (&(objectclass=posixAccount)(objectclass=ldapPublicKey)(uid=user2)) ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsDA+I14oBeVd7ceujknbvc3i2Qfnx2Q1vPatRcwPfWLF2H4fPUuUypkJjswvJXxZun+7h1tNpZPMvKCxMLNph4follk35MXT01LZYtW3rs3bdYL+9vBO7ns1+MDrrusotM3f+j90VhPVn5MhgPABVAaSVoTGn058d/N/R1pMMvnRrKhBYlLG0Yb4WesvJQCL9GkbPqjn7tWZQNbDqnIA/TgYe87ES7rsC8ZFObSYYhWXJqnYb8ysQRVLTRUxE/EzYWM0YUIuYIN9eRzUJW9rFmlVDalUjzwIK6dkhkl4xN3vX5lSL3OCJlwIxUoQLK2P9fEvbPlxd9IRSQNWFJO2HQ==mvadkert@dhcp-lab-118.englab.brq.redhat.com debug2: LDAP process user finished debug1: LDAP do close debug2: LDAP do close OK
 * omoris and jvcelak added openssh.scheme and a test user
 * tested with ssh-ldap-helper

[jvcelak] Tested program: python-ldap-2.3.12-1.fc15.x86_64

import ldap import ldap.modlist as modlist l = ldap.initialize("ldaps://openldap03.fedoraproject.org", trace_level = 1) l.simple_bind_s("cn=Tester,dc=gold,dc=testday", "openldap") ldif = modlist.addModlist({ "objectClass" : [ "organizationalUnit", "top" ], "ou" : [ "jvcelak" ], }) l.add_s("ou=jvcelak,ou=free,dc=gold,dc=testday", ldif) print l.search_s("dc=gold,dc=testday", ldap.SCOPE_SUBTREE, "(cn=Manager)") l.delete_s("ou=jvcelak,ou=free,dc=gold,dc=testday") l.unbind_s
 * not tested very deeply, basic operations work:
 * 1) !/usr/bin/python

[mvadkert] Tested program: libuser-0.56.18-2.fc14
 * tested all libuser commands - found bug in lpasswd #643022
 * generally works well after good setup in /etc/libuser.conf

[omoris] Tested program: pam_ldap-185-5.fc14
 * tested password change, ssh connection, password change via ssh connection
 * no problems, works fine
 * testes via beakerlib using already prepared testcases

[omoris] Tested program: nss_ldap-265-6.fc14 & nss-pam-ldapd.i686 0:0.7.7-1.fc14 
 * tested getent, id of ldap users
 * no problems, works fine
 * testes via beakerlib using already prepared testcases

[mvadkert] Tested program: quota-3.17-13.fc14.x86_64
 * mail stored in surname in LDAP user, quota works as expected with ldaps :)

[amarecek] Tested program: sudo-1.7.4p4-3.fc14.x86_64
 * rights escalation with ldap users only
 * rights escalation with local users and ldap groups
 * rights escalation with ldap users containing white spaces (also "su" tested)
 * rights escalation with ldap groups containing white spaces

[jgorig] Tested program: php-ldap-5.3.3-1.fc14.x86_64 <?php $conn = ldap_connect("openldap03.fedoraproject.org"); if(!$conn) exit(ldap_error($conn)); $ret = ldap_start_tls($conn); if(!$ret) exit(ldap_error($conn)); $r = ldap_bind($conn, "cn=Tester,dc=gold,dc=testday", "openldap"); if(!$r) exit(ldap_error($conn)); $data["objectClass"][0] = "organizationalUnit"; $data["objectClass"][1] = "top"; $data["ou"] = "Testovac"; ldap_add($conn, "ou=Testovac,ou=free,dc=gold,dc=testday", $data); $sr = ldap_search($conn, "dc=gold,dc=testday", "ou=Testovac"); print_r(ldap_get_entries($conn, $sr)); ldap_delete($conn, "ou=Testovac,ou=free,dc=gold,dc=testday"); ldap_close($conn);
 * basic operations works

[amarecek] Tested program: ruby-1.8.7.302-1.fc14.x86_64, ruby-ldap-0.9.7-10.fc12.x86_64 require 'ldap' _host = 'openldap03.fedoraproject.org' _port = 389 _binddn = 'cn=Tester,dc=gold,dc=testday' _bindpw = 'openldap' _base = 'ou=alich,ou=free,dc=gold,dc=testday' connection = LDAP::Conn.new(_host, _port) connection.bind(_binddn, _bindpw) connection.perror("bind") scope = LDAP::LDAP_SCOPE_SUBTREE attrs = ['dn', 'cn'] items = ['posixAccount', 'posixGroup'] items.each { |item| filter = "(objectClass=#{item})" begin connection.search(_base, scope, filter) { |record| print "DN: #{record.dn}\n" print "ATTRS: #{record.attrs}\n" print "\tCN: #{record.vals('cn')}\n" print "#{record.to_hash}\n" }       rescue LDAP::ResultError connection.perror("search") exit 1 end connection.perror("search") } connection.unbind
 * simple connection works
 * 1) !/bin/env ruby
 * all data were found successfully

[jvcelak] Tested program: autofs-5.0.5-31.fc15.x86_64
 * reported bug #643045 (outdated autofs.schema in openldap-servers)
 * automounter connects to LDAP server with TLS (ldap:// + requiretls, ldaps://)
 * automountMap successfully found
 * referring to another server using ldap:server:dn works
 * volumes mounted as expected

'''[shanks] Tested program: sssd-1.3.0-35.fc14.x86_64 [sssd[be[LDAP]]] [get_server_status] (7): Status of server 'fed14sssdldap.gsr.pnq.redhat.com' is 'working' [sssd[be[LDAP]]] [be_resolve_server_done] (4): Found address for server fed14sssdldap.gsr.pnq.redhat.com: [10.65.201.183] [sssd[be[LDAP]]] [sdap_connect_send] (4): Executing START TLS [sssd[be[LDAP]]] [sdap_ldap_connect_callback_add] (9): New LDAP connection to [ldap://fed14sssdldap.gsr.pnq.redhat.com:389] with fd [26]. [sssd[be[LDAP]]] [sdap_process_result] (8): Trace: sh[0xe9d210], connected[1], ops[0xe7e280], ldap[0xea1220] [sssd[be[LDAP]]] [sdap_connect_done] (3): START TLS result: Success(0), Start TLS request accepted.Server willing to negotiate SSL. [sssd[be[LDAP]]] [fo_set_port_status] (4): Marking port 389 of server 'fed14sssdldap.gsr.pnq.redhat.com' as 'working' [sssd[be[LDAP]]] [set_server_common_status] (4): Marking server 'fed14sssdldap.gsr.pnq.redhat.com' as 'working' [sssd[be[LDAP]]] [ldb] (9): tevent: Added timed event "ltdb_callback": 0xec7d50 [sssd[be[LDAP]]] [ldb] (9): tevent: Added timed event "ltdb_timeout": 0xec78c0 [sssd[be[LDAP]]] [ldb] (9): tevent: Destroying timer event 0xec78c0 "ltdb_timeout" [sssd[be[LDAP]]] [ldb] (9): tevent: Ending timer event 0xec7d50 "ltdb_callback" [sssd[be[LDAP]]] [find_password_expiration_attributes] (9): No password policy requested. [sssd[be[LDAP]]] [simple_bind_send] (4): Executing simple bind as: uid=puser1,ou=People,dc=example,dc=com [sssd[be[LDAP]]] [simple_bind_send] (8): ldap simple bind sent, msgid = 2 [sssd[be[LDAP]]] [sdap_process_result] (8): Trace: sh[0xe9d210], connected[1], ops[0xec79e0], ldap[0xea1220] [sssd[be[LDAP]]] [sdap_process_result] (8): Trace: ldap_result found nothing! [sssd[be[LDAP]]] [sdap_process_result] (8): Trace: sh[0xe9d210], connected[1], ops[0xec79e0], ldap[0xea1220] [sssd[be[LDAP]]] [simple_bind_done] (5): Server returned no controls. [sssd[be[LDAP]]] [simple_bind_done] (3): Bind result: Success(0), (null)
 * Not tested deeply, basic operation of LDAP ID and auth works:

[jgorig] Tested program: proftpd-1.3.3b-1.fc14.x86_64
 * user authentication works
 * Mustuniversity
 * Must University