Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
HAProxy ldap-check compatible with Windows Server / Active Directory
# Note : Found somewhere on internet... Source lost
backend ldap_balancer
mode tcp
balance roundrobin
server SERVER_NAME SERVER_ADDR:389 maxconn 100 check
option tcpka
timeout server 2s
timeout connect 1s
# Below, ldap check procedure :
option tcp-check
tcp-check connect port 389
tcp-check send-binary 300c0201 # LDAP bind request "<ROOT>" simple
tcp-check send-binary 01 # message ID
tcp-check send-binary 6007 # protocol Op
tcp-check send-binary 0201 # bind request
tcp-check send-binary 03 # LDAP v3
tcp-check send-binary 04008000 # name, simple authentication
tcp-check expect binary 0a0100 # bind response + result code: success
tcp-check send-binary 30050201034200 # unbind request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment