Diane's World

I take the 5th


Tue, 09 Aug 2005

So i was trying to get OpenLDAP to work and I kept getting connection errors when I tried accessing over openssl.

$ ldapsearch -H ldaps://127.0.0.1/ -b dc=mydomain -x ldap_bind: Can't contact LDAP server (-1)

It turns out that the problem was in my /etc/ldap.conf file

http://www.openldap.org/lists/openldap-software/200409/msg00060.html

suggested using -d 1

The interesting line was

TLS: could not load verify locations (file:/etc/ldap/slapd.pem',dir:').

Ah! I'd renamed that file... so it was trying to validate the self signed server cert which wasn't working... ok

However the openldap howto http://www.openldap.org/pub/ksoper/OpenLDAP_TLS_howto.html recommended putting both the public and private key into the same file. Since it appears i need to distribute the key to my client machines it'd be really nice if they were seperate.

Ok now I get it...

In the ldap.conf file you need to make sure that TLS_CACERT is pointing to either the certificate (for self signed certs) or the certificate authority chain (for trusted certs)

Note it's also important for the base to be set properly in /etc/ldap/ldap.conf (it certainly cuts down on the amount of typing one needs to do)

To get apache to work I needed to add LDAPTrustedCA /etc/ldap/mus-slapd.crt.pem LDAPTrustedCAType BASE64_FILE to get apache to me happy with my cert, and i still think its using ssl and not tls.

installed pam_ldap and nss_ldap, they both wanted a proxy user for authentication, and also the admin user for changing passwords.

[19:41] | [] | # | G


menu

About Diane Trout
Blog

calendar

< August 2005 >
SuMoTuWeThFrSa
  1 2 3 4 5 6
7 8 910111213
14151617181920
21222324252627
28293031   

categories

/ (123)
  geek/ (37)
    debian/ (2)
    programming/ (1)
    t41/ (6)
    voip/ (1)
  government/ (7)
    tac/ (3)
  life/ (8)
    transhuman/ (1)
    vegan/ (2)
      recipes/ (2)
  study/ (49)
    arma/ (1)
    bi188/ (8)
    cs191a/ (6)
    ese166/ (25)
  work/ (21)
    compclust/ (6)
    sigmoid/ (1)
    talks/ (1)