I'm switching from ldap:// to ldaps://
After I've figured out how to connect using ldaps and that I can't use ldaps with the domainname instead of an hostname, I'm wondering how to solve this.
So what's working:
ldap_connect('ldaps://dc1.example.com:636');
What's not working:
ldap_connect('ldaps://example.com:636');
While dc1.example.com is the hostname of my first dc, example.com is a DNS entry which resolves to multiple IPs of my domain controllers.
What did I do next? Using openssl I've figured out that the domain controller chosen by the answer of the DNS-Server using example.com will result in an ldap connection error. is it that the chosen domain controller answers with its hostname certificate (dc1.example.com) instead of the "domain" certificate (example.com)? Can I disable that check with an ldap option on the connection? Or any other suggestions? I don't want to list all those domain controllers in the connection string, cause it will hang for several seconds, if one of them is not available. Using the domain name will "remove" the failing dc.