auth.backend.ldap.starttls encrypts authenticating user password, but not auth.backend.ldap.bind-pw
Just setup lighttpd with the following:
auth.backend = "ldap"
auth.backend.ldap.hostname = "junewts.domain.net"
auth.backend.ldap.base-dn = "dc=domain,dc=net"
auth.backend.ldap.filter = "(&(objectClass=user)(sAMAccountName=$)(memberOf=CN=Allowed,CN=Users,DC=domain,DC=net))"
auth.backend.ldap.starttls = "enable"
auth.backend.ldap.bind-dn = "CN=lookupuser,CN=Users,DC=domain,DC=net"
auth.backend.ldap.bind-pw = "password"
auth.backend.ldap.allow-empty-pw = "disable"
When sniffing the packets with tcpdump, I see it bind as lookupuser without starting tls, then it starts TLS and tries to bind as the user it found in the filter.
When selecting starttls ligttpd should encrypt both the bind to lookup the user, as well as the bind as the user.
I can't confirm this. According to my packet capture I get this:
LDAPMessage bindRequest(16) "CN=lookupusr,CN=Users,DC=domain,DC=net" simple
protocolOp: bindRequest (0)
authentication: simple (0)
then a few searches, then unbindRequest then....
72 0.017358 172.24.0.211 172.24.0.237 TLSv1 371 Client Hello
76 0.023452 172.24.0.237 172.24.0.211 TLSv1 4664 Server Hello, Certificate, Server Key Exchange, Certificate Request, Server Hello Done
So it's pretty clearly only doing TLS for the user part, not the bind-dn part.
I'm using lighttpd-1.4.50.tar.xz compiled like this on slackware:
openldap is openldap-client-2.4.42-x86_64-1 from slackware.
If you want I can send you the packet capture, but don't want to post it here, as it's has private information.
- Status changed from New to Reopened
I finally got around to setting up a full environment and I could not replicate the behavior that you have reported. I am using a self-signed certificate, and tried both ldaps and starttls (separately; not at the same time). strace and tcpdump show lighttpd sending encrypted traffic to the ldap server (which I ran on 127.0.0.1).
For a simple testing environment, I followed:
TLS_REQCERT allow in /etc/openldap/ldap.conf for use with my self-signed cert.
auth.backend.ldap.hostname = "ldap://127.0.0.1/" auth.backend.ldap.starttls = "enable"
auth.backend.ldap.hostname = "ldaps://127.0.0.1/" auth.backend.ldap.starttls = "disable"
My test system is running lighttpd 1.4.52 on RedHat Fedora 29 with:
(You reported Slackware, lighttpd 1.4.50, and openldap-client 2.4.42)
The last substantive change to mod_authn_ldap was d5f37803 in lighttpd 1.4.49. I do not think what you have reported is an issue with lighttpd. Would you please test with a later version of openldap-client? Outside of lighttpd, would you try a packet capture when testing with
ldapsearch -ZZ ... (which forces starttls)?
Also available in: Atom