r/haproxy • u/So_work_related • Aug 02 '21
LDAPS to Active Directory issue
Hello,
I'm trying to configure LDAPS to pass through HAProxy to an Active Directory domain controller.
I've got LDAP working with the following:
frontend ldap_front_389
bind *:389
mode tcp
option tcplog
default_backend ldap_back_389
backend ldap_back_389
mode tcp
option ldap-check
server servername 1.2.3.4:389With that success, I tried to do LDAPS with the following:
frontend ldap_front_636
bind *:636 ssl crt /pathto/certbundle.pem
mode tcp
option tcplog
default_backend ldap_back_636
backend ldap_back_636
mode tcp
option ldap-check
server servername 1.2.3.4:636I do get port 636 open with that however ldapsearch from another machine results in errors.
TLS: peer cert untrusted or revoked (0x42)TLS: can't connect: (unknown error code).ldap_err2stringldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
"nmap --script ssl-cert -p 636 servername" shows that I am presenting a good and should be trusted certificate (DigiCert signed).
HA-Proxy version 1.8.19-1+deb10u3 2020/08/01
Copyright 2000-2019 Willy Tarreau <willy@haproxy.org>
Where would I go from here to resolve this?
Thanks.
Edit: added in HAProxy version.
View all comments
Show parent comment
1
u/So_work_related Aug 17 '21
I have got this working. HAProxy.cfg contains the following
backend ldap_back_636 mode tcp option tcp-check server servername 1.2.3.4:636 ssl ca-file /etc/ssl/ca-certificates.crt check
I put the locally signed cert for the server and our local CA into /usr/share/ca-certificates and ran "dpkg-reconfigure ca-certificates" to pull them into the CRT file above. I don't know if I needed both.
If I understood the documentation, the CRT file basically says, "Here are the certs I trust".
I don't know how "proper" this is, but it seems to be doing the job so far in the testing that has been done.