ARLIAN
10/20/2015 - 5:56 AM

HAProxy ldap-check compatible with Windows Server / Active Directory

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