I have set up an openldap server including tls on ubuntu 14.04 following this guide.
While testing the connection, I get results that I can not find an explanation for.
ldapsearch -xLLL -Z -W -D cn=admin,cn=config -b cn=config cn=config
results in
dn: cn=config
objectClass: olcGlobal
cn: config
olcArgsFile: /var/run/slapd/slapd.args
olcLogLevel: none
olcLogLevel: stats
olcPidFile: /var/run/slapd/slapd.pid
olcTLSCACertificateFile: /etc/ssl/certs/cacert.pem
olcTLSCertificateFile: /etc/ssl/certs/ldap01_slapd_cert.pem
olcTLSCertificateKeyFile: /etc/ssl/private/ldap01_slapd_key.pem
olcToolThreads: 1
as expected. But increasing debug level
ldapsearch -d 2 -xLLL -Z -W -D cn=admin,cn=config -b cn=config cn=config
results in
ldap_write: want=31, written=31
0000: 30 1d 02 01 01 77 18 80 16 31 2e 33 2e 36 2e 31 0....w...1.3.6.1
0010: 2e 34 2e 31 2e 31 34 36 36 2e 32 30 30 33 37 .4.1.1466.20037
ldap_read: want=8, got=8
0000: 30 0c 02 01 01 78 07 0a 0....x..
....
Enter LDAP Password:
....
00a0: a6 c4 2f 78 97 fb e1 ea ce c3 03 d6 8c 0e fa 75 ../x...........u
00b0: df e7 89 91 e8 df e2 70 94 ca d3 c7 5c af a0 d0 .......p....\...
00c0: bf 76 10 70 47 .v.pG
tls_write: want=117 error=Bad file descriptor
So, what makes me skeptical is the message error=Bad file descriptor.
My /etc/ldap/ldap.conf is
uri ldap://myfqdn/
ldap_version 3
ssl start_tls
tls_cacert /etc/ssl/certs/cacert.pem
TLS_REQCERT allow
In /var/log/syslog I see for the last test
Jan 8 17:03:00 kyrill slapd[29857]: conn=1008 op=0 EXT oid=1.3.6.1.4.1.1466.20037
Jan 8 17:03:00 kyrill slapd[29857]: conn=1008 op=0 STARTTLS
Jan 8 17:03:00 kyrill slapd[29857]: conn=1008 op=0 RESULT oid= err=0 text=
Jan 8 17:03:00 kyrill slapd[29857]: conn=1008 fd=19 ACCEPT from IP=127.0.0.1:39973 (IP=0.0.0.0:389)
Jan 8 17:03:00 kyrill slapd[29857]: conn=1008 fd=19 TLS established tls_ssf=128 ssf=128
Jan 8 17:03:04 kyrill slapd[29857]: conn=1008 op=1 BIND dn="cn=admin,cn=config" method=128
Jan 8 17:03:04 kyrill slapd[29857]: conn=1008 op=1 BIND dn="cn=admin,cn=config" mech=SIMPLE ssf=0
Jan 8 17:03:04 kyrill slapd[29857]: conn=1008 op=1 RESULT tag=97 err=0 text=
Jan 8 17:03:04 kyrill slapd[29857]: conn=1008 op=2 SRCH base="cn=config" scope=2 deref=0 filter="(cn=config)"
Jan 8 17:03:04 kyrill slapd[29857]: conn=1008 op=2 SEARCH RESULT tag=101 err=0 nentries=1 text=
Jan 8 17:03:04 kyrill slapd[29857]: conn=1008 op=3 UNBIND
Jan 8 17:03:04 kyrill slapd[29857]: conn=1008 fd=19 closed
Jan 8 17:03:04 kyrill slapd[29857]: connection_read(19): no connection!
Actually, I have no idea how to track this down. Any help or suggestion is appreciated.