473,807 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ldap.set_option (ldap.OPT_X_TLS _CACERTFILE...) error

3 New Member
Hi,

I have a simple LDAPS script:

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/python2.3
  2. import sys
  3. import ldap
  4.  
  5. if __name__ == '__main__':
  6.         ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
  7.         ldapmodule_trace_level = 1
  8.         ldapmodule_trace_file = sys.stdout
  9.         ldap.set_option(ldap.OPT_X_TLS_ALLOW,1)
  10.         ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, "/etc/ssl/certs/f64d9715.0")
  11.  
executing fine on one server, however having it on another server throws the following error:
Expand|Select|Wrap|Line Numbers
  1.  
  2.   File "./test2.py", line 12, in ?
  3.     ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, "/etc/ssl/certs/f64d9715.0")
  4.   File "/usr/lib/python2.3/site-packages/ldap/functions.py", line 104, in set_option
  5.     _ldap_function_call(_ldap.set_option,option,invalue)
  6.   File "/usr/lib/python2.3/site-packages/ldap/__init__.py", line 62, in _ldap_function_call
  7.     result = apply(func,args,kwargs)
  8. ldap.LDAPError: {'errnum': -1}
I have validated the certificate is correct using an openSSL command (get a "Verify return code: 0 (ok)"). The only difference I can see is that the one that is working is using openSSL 0.9.7e and Python 2.3.5, while the one not working is using openSSL 0.9.6c and Python 2.3.4. Is this enough to cause an error? I have been unable to find any requirements for ldap.OPT_X_TLS_ CACERTFILE. Unfortunately upgrading the openSSL and Python is a big job considering the amount of testing of existing python scripts on the server, so I need to make sure this is the issue.
TIA.
May 18 '07 #1
3 5513
bartonc
6,596 Recognized Expert Expert
Hi,

I have a simple LDAPS script:

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/python2.3
  2. import sys
  3. import ldap
  4.  
  5. if __name__ == '__main__':
  6.         ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
  7.         ldapmodule_trace_level = 1
  8.         ldapmodule_trace_file = sys.stdout
  9.         ldap.set_option(ldap.OPT_X_TLS_ALLOW,1)
  10.         ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, "/etc/ssl/certs/f64d9715.0")
  11.  
executing fine on one server, however having it on another server throws the following error:
Expand|Select|Wrap|Line Numbers
  1.  
  2.   File "./test2.py", line 12, in ?
  3.     ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, "/etc/ssl/certs/f64d9715.0")
  4.   File "/usr/lib/python2.3/site-packages/ldap/functions.py", line 104, in set_option
  5.     _ldap_function_call(_ldap.set_option,option,invalue)
  6.   File "/usr/lib/python2.3/site-packages/ldap/__init__.py", line 62, in _ldap_function_call
  7.     result = apply(func,args,kwargs)
  8. ldap.LDAPError: {'errnum': -1}
I have validated the certificate is correct using an openSSL command (get a "Verify return code: 0 (ok)"). The only difference I can see is that the one that is working is using openSSL 0.9.7e and Python 2.3.5, while the one not working is using openSSL 0.9.6c and Python 2.3.4. Is this enough to cause an error? I have been unable to find any requirements for ldap.OPT_X_TLS_ CACERTFILE. Unfortunately upgrading the openSSL and Python is a big job considering the amount of testing of existing python scripts on the server, so I need to make sure this is the issue.
TIA.
That's not a very friendly error message.
The current version of ldap installs as a package and is probably available for 2.3.
In 2.4, using this (not so clean, but quick test):
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/python2.4
  2. import sys
  3. from ldap import *
  4.  
  5. if __name__ == '__main__':
  6.     set_option(OPT_DEBUG_LEVEL,255)
  7.     ldapmodule_trace_level = 1
  8.     ldapmodule_trace_file = sys.stdout
  9.     set_option(OPT_X_TLS_ALLOW,1)
  10.     set_option(OPT_X_TLS_CACERTFILE, "/etc/ssl/certs/f64d9715.0")
  11.  
I received no errors.
I believe that keeping your software up-to-date is worth the work (that way, things like this are less likely to occure.
May 18 '07 #2
sallas
3 New Member
Thanks Bartonc, I may have to set up a Test machine so as to trial with the 'old' library versions to prove this is the issue.
Yes, it would be best to keep all software libraries up to date. Unfortunately I'm not the UNIX programmer/owner of this server (am doing their job of modifying scripts to connect to my MS Active Directory) and have been informed that there have been no system upgrades as they cause issues with other applications on the server (sigh).
May 22 '07 #3
bartonc
6,596 Recognized Expert Expert
Thanks Bartonc, I may have to set up a Test machine so as to trial with the 'old' library versions to prove this is the issue.
Yes, it would be best to keep all software libraries up to date. Unfortunately I'm not the UNIX programmer/owner of this server (am doing their job of modifying scripts to connect to my MS Active Directory) and have been informed that there have been no system upgrades as they cause issues with other applications on the server (sigh).
You are welcome. You can call me "Barton".
May 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2678
by: Durairaj Avasi | last post by:
Here is my prg:::: use Net::LDAP qw(LDAP_SUCCESS LDAP_PROTOCOL_ERROR); use Authen::SASL; use Net::LDAP::Util qw(ldap_error_name ldap_error_text); sub lConnect { my $server = shift; print " the server name is $server\n"; my $ldap = Net::LDAP->new($server, port=> 389, version => 3);
7
6817
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or credentials. What i am trying to do is, i am trying to look up all the information for the user with user id 'testuser'. The following is the Vb.net code for my aspx page: Dim oRoot As DirectoryEntry = New...
1
4760
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I have a page in a folder (under anonymous authentication in IIS6) that has a link on it that...
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
3237
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
6
7790
by: hotani | last post by:
I am attempting to pull info from an LDAP server (Active Directory), but cannot specify an OU. In other words, I need to search users in all OU's, not a specific one. Here is what works: con = ldap.initialize("ldap://server.local") con.simple_bind_s('user@domain', pass) result = con.search_ext_s( 'OU=some office, DC=server, DC=local',
2
2288
by: theiviaxx | last post by:
Thanks for the help guys, it works! I used the ldap.set_option(ldap.OPT_REFERRALS, 0) from http://peeved.org/blog/2007/11/20/ immedialtey after import, then did the initialize trace_level=2 and did the simple_bind_s. I was able to search and get the results. That trace_level thing is nice, i'm sure i will be debugging this more as i move forward :) Not sure if this is an AD thing or just something i needed to do with our particular...
2
5572
by: jo3c | last post by:
Hi.. Im trying to get some information out of a windows sever 2003 chinese active directory system so let's say encoding is probably big5 or utf-8 what im doing is simliar to ldapsearch in shell with my python script using python ldap module the result is not the correct encoding..
0
1866
by: Sells, Fred | last post by:
I'm running python 2.5 (or 2.4) in an XP environment. I downloaded and installed the .dll's from OpenLDAP-2.4.8+OpenSSL-0.9.8g-Win32.zip and copied the .dll's in c:/windows/system32 as instructed now I get this error. Is there anyway to avoid building the python_ldap binaries? Apart from being lazy, I've got a secure system policy issue if I start compiling apps. I could give up and just start running in linux, but myxp environment is...
0
9720
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
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10626
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...
0
10112
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9193
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
7650
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
5546
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...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.