473,800 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ 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("l dap://$ad_server/") ,"389"); // Connect to an LDAP
server
echo $debug?"<BR>LDA P 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_opti on($ds, LDAP_OPT_PROTOC OL_VERSION, 3)) {
die ("Failed to set LDAP Protocol version to 3, TLS not
supported.");
}
if (!ldap_start_tl s($ds)) {
die ("Ldap_start_tl s failed");
}
if (ldap_bind ($ds, $serv_user, $serv_pass)) { # Bind Ok
The result is:
LDAP Connection handler:Resourc e id #2

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

TIA

Luca Bighi
Jul 17 '05 #1
0 2766

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

Similar topics

3
9883
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 seem to get this to work in VB.Net. Here's what I have: OLD ASP Code: Function Get_ADS_Users_For_Group(ADS_Path) Dim Group_Information Dim Error_Number
3
2097
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 ones) Has anyone got any ideas? Thanks
0
1000
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 error messages but it does not change ldap. I've tried it with uid = 'joeblow' and with oldpw=whatever it was with the same result. Anyone know what I'm missing?
1
2627
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 error messages but it does not change ldap. I've tried it with uid = 'joeblow' and with oldpw=whatever it was with the same result. Anyone know what I'm missing?
3
7087
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 authenticate(String username, String password) throws javax.naming.NamingException { SearchControls sc; NamingEnumeration ne; Hashtable<String,Stringh = new Hashtable<String,String>();
1
4845
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 "CN=ANYCOMPUTER,CN=Computers,DC=mydomain,DC=com" How can I do this with python-ldap?
2
4210
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"; $mesg=$ldap->bind("uid=testuser,ou=applicationstest,o=systemresourcestest,o=hainet,dc=hainet,dc=com",password=>"secret"); $cn="$last_name $first_name";
0
3235
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 given all the attributes which are needed, for the user, in the code and also the proper path where the user has to be added. Please have a look at my code CODE] // This is a class file which stores all the info required for the user
2
6490
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): File "/home/juan/workspace/amquare/src/nutum/amquare/amquare.py", line 122, in <module> conn.connect()
3
3245
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 attempt was: SELECT 1+instr(T.ldap,"=") as startpos, instr(T.ldap,",") as endpos, mid(T.ldap,startpos,endpos-startpos)
0
9695
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10514
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10260
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9099
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7588
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6826
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5479
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3770
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2956
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.