473,472 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ldap-start-tls to connect to AD server

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
server
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>";
exit;
}
else {
if (!ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) {
die ("Failed to set LDAP Protocol version to 3, TLS not
supported.");
}
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

TIA

Luca Bighi
Jul 17 '05 #1
0 2753

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chad Beckner | last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able to query ADS to get a users groups that they belong to, and also query a group and get a list of users. However, I can't...
3
by: Phil Kelly | last post by:
Hi! I am trying to delete an LDAP attribute using VB.NET (2003) but cannot find any syntax that supports this operation. I need to remove (say) the 'company' attribute (not one of the mandatory...
0
by: Sells, Fred | last post by:
I've got the python-ldap version 2.0.11 with python 2.4 under Linux I've got the ldap stuff working for groups, but now I'm trying to use it to change a user password. I get a return of 2 and no...
1
by: Sells, Fred | last post by:
I've got the python-ldap version 2.0.11 with python 2.4 under Linux I've got the ldap stuff working for groups, but now I'm trying to use it to change a user password. I get a return of 2 and no...
3
by: mbasil77 | last post by:
I'm trying to port a piece of Java LDAP conneciton code to DOTNET. I've done LDAP in DOTNET before, but I keep getting a very strange message. The Java code looks like: public static boolean...
1
by: Nico Grubert | last post by:
Hi there, on a linux machine I am running this ldapsearch from the command line: ldapsearch -x -h myldaphost.mydomain.com \ -D "CN=ldapuser,CN=Users,DC=mydomain,DC=com" -w "secret" \ -b...
2
by: jjeanj1 | last post by:
Hi, all i am writing a perl script to do a a bulk add of users from a file and load it to LDAP $ldap = Net::LDAP->new("test.domain.com", port=>3394) or die "Can not connected to LDAP \n"; ...
0
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have...
2
by: Juan | last post by:
Hi I am trying to make a simple Python script using LDAP. The module is imported OK, but when I call the function open or initialize, I get this error: Traceback (most recent call last):...
3
by: Marjeta | last post by:
I have a table with one of the columns being ldap info. Example value would be: ou=FOO,ou=BAR,o=XYZ,dc=WORLD From this I would like to extract the first string, in this case FOO. My last...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.