note 68733 added to function.ldap-bind
| From: | david dot marsh at hartfordlife dot com | Date: | Tue, 08 Aug 2006 19:49:13 +0000 |
| Subject: | note 68733 added to function.ldap-bind | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115701@lists.php.net to get a copy of this message | ||
had to do a bunch of research on this, but it does work, once config'd correctly.
using Apache/2.2.3 (Win32) mod_ssl/2.2.3 OpenSSL/0.9.8b
PHP PHP Version 5.1.5-dev
ldap_bind was getting "81 Can't contact LDAP server" which was really annoying, since
the connection worked fine without "ldaps"
using:
$ldapconnect = @ldap_connect( $connection_string );
well, actually the bind was really the one failing...
$bind = ldap_bind($ldapconnect, $client, $this->objSecurityLogin->Password);
many attempts to determine until i smartened up and turned on the trace level:
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
which must go before the connect!
found that on windows, you can't specifiy a quote in the ldap.conf:
i had:
TLS_REQCERT never
TLS_CACERT "C:\\Documents\\Tools\\Apache2\\conf\\ssl\\ad.pem"
which throws the error..
TLS: could not load verify locations
(file:
"C:\Documents\Tools\Apache2\conf\ssl\ad.pem"',dir:').
TLS: error:0200107B:system library:fopen:Unknown error .\crypto\bio\bss_file.c:122
TLS: error:2006D002:BIO routines:BIO_new_file:system lib .\crypto\bio\bss_file.c:127
TLS: error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib
.\crypto\x509\by_file.c:274
ldap_err2string
changed to:
TLS_REQCERT never
TLS_CACERT C:\\Documents\\Tools\\Apache2\\conf\\ssl\\ad.pem
which cleans it up as:
TLS trace: SSL_connect:before/connect initialization
TLS trace: SSL_connect:SSLv2/v3 write client hello A
TLS trace: SSL_connect:SSLv3 read server hello A
TLS certificate verification: depth: 1, err: 0, subject: /DC=xxx/DC=yyy/CN=zzzz, issuer:
/DC=abab/DC=yyy/CN=zzzz
TLS certificate verification: depth: 0, err: 0, subject: ......
so the moral to the story is even though PHP wants quotes in some windows config parms, it
won't work if its in ldap.conf!
----
Server IP: 216.194.113.175
Probable Submitter: 162.136.192.1
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.ldap-bind.php
Edit -- https://master.php.net/note/edit/68733
Del: integrated -- https://master.php.net/note/delete/68733/integrated
Del: useless -- https://master.php.net/note/delete/68733/useless
Del: bad code -- https://master.php.net/note/delete/68733/bad+code
Del: spam -- https://master.php.net/note/delete/68733/spam
Del: non-english -- https://master.php.net/note/delete/68733/non-english
Del: in docs -- https://master.php.net/note/delete/68733/in+docs
Del: other reasons-- https://master.php.net/note/delete/68733
Reject -- https://master.php.net/note/reject/68733
Search -- https://master.php.net/manage/user-notes.php