By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,713 Members | 1,369 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,713 IT Pros & Developers. It's quick & easy.

ldap-start-tls to connect to AD server

P: n/a
I try to use ldap-star-tls to connect to a win2003 domain controller and
browse AD.
$ds = ldap_connect("ldap://$ad_server/") ,"389"); // Connect to an LDAP
echo $debug?"<BR>LDAP Connection handler:$ds<BR>":"";
if ($ds == 0) {
echo "<H1>Cannot connect to LDAP server to authenticate</H1>";
echo "<H3>Use the browser back button to continue</H3>";
else {
if (!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
die ("Failed to set LDAP Protocol version to 3, TLS not
if (!ldap_start_tls($ds)) {
die ("Ldap_start_tls failed");
if (ldap_bind ($ds, $serv_user, $serv_pass)) { # Bind Ok
The result is:
LDAP Connection handler:Resource id #2

Warning: ldap_start_tls() [function.ldap-start-tls]: Unable to start TLS:
Connect error in C:\WEBROOT\ad.php on line 30
Ldap_start_tls failed


Luca Bighi
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.