I can not connect to LDAPS server (3rd party) from PHP (PHP 5.5.4, Apache 2.4, Windows 7 64bit). When I'm trying ldap_bind()
function with userdn and password, I receive - Unable to bind to server: Can't contact LDAP server.
I have self-signed certificate from the LDAPS server, but I don't know where to put the PEM file (Base64) or something like conf.file (I have read many answers for this, but nothing works for me - e.g. c:\openldap\sysconf\ldap.conf
, TLS_REQCERT
never etc.).
Development folder is D:\WebDev
where inside is \www
folder with projects and \binaries
folder with \Apache
folder and \PHP
folder. PHP is an module for Apache and Apache is started by httpd.exe --standalone --console
.
Openssl s_client -connect xxxx -CAfile xxxx
to LDAPS server works good, return code is 0
. Without -CAfile
I fet code 19 (self-signed certificate in certificate chain)
.
LDAP without SSL works fine for me, I've tried some free online LDAP test server.