I have been attempting to setup a secure login between my locally hosted intranet website and the AD server for my employer. I have a bitnami wordpress stack. I have enabled both ldap extensions in php and apache config files. I also have placed the SSL certs that are valid for my domain and in the browser come back as valid.
The PHP for this is
$test=ldap_connect("ldap://domain.com") ;
ldap_set_option($test, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($test, LDAP_OPT_REFERRALS, 0);
if (ldap_start_tls($test)) {
$test2=ldap_bind($test);
if($test2===true) {
ldap_close($test2);
}
}
else {
echo "tls failed to start";
}
This fails after the AD server hello, my client server sends back a "(Level: Fatal, Description: Unknown CA)"
My apache server gives an error of "ldap_bind(): Unable to bind to server: Can't contact LDAP server in C:\dir"
I believe this is possibly an error with how to tell apache that the AD server certificate is valid, but I do not know where to put it or exactly how to do it. There is no ldap config file anywhere in my dir.
Any help is much appreciated.