This function takes the following parameters:
Host on which the LDAP server is running
Port on which the LDAP server is listening
1 for a secure connection over SSL, NULL otherwise
If not NULL, then the connection may be shared between threads