Add ability to debug ldap connections.

This can be very useful when debugging certificate issues
when using using ldaps (secure ldap).