$ldaphost = "ldaps://ldap.example.com:636";$ldapUsername = "uid=rosu,ou=Users,o=myorg,dc=example,dc=com";$ldapPassword = "mypass";$ldapBasedn = "o=myorg,dc=example,dc=com";$ds = ldap_connect($ldaphost);ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);$bth = ldap_bind($ds, $ldapUsername, $ldapPassword);$search = ldap_search($ds, $ldapBasedn, "(cn=*)");echo ldap_count_entries($ds,$search);$info = ldap_get_entries($ds, $search);print_r($info);
openssl s_client -connect ldap.foxpass.com:636 -showcerts
Again it worked perfectly fine if I wasn't using SSL/STARTTLS, but this was to be expected as I hadn't specified the cert chain to validate. I created the ldap.conf file under C:\OpenLDAP\sysconf\ldap.conf and added TLS_REQCERT never which allowed LDAPS to work on my machine. I'll test specifying the certificate chain to validate in ldap.conf on my machine and see if it works.