Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python-ldap set_option not working on Yosemite

We've installed the python-ldap(2.4.19) module without errors and perform most of the operations successfully. However ldap.set_option always returns a exception when we try to load certificates to use ssl (ldaps).

It occurs on notebooks running Yosemite but not on Mavericks or Linux. (All Macbooks have xcode installed)

We think it should be some missing/outdated/updated lib but we don't know how to find it.

Any clues?

$python
Python 2.7.6 (default, Sep  9 2014, 15:04:36)
...
>>>import ldap
>>>ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, '/my_path/my_cert.crt')
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/*xxx*/python2.7/site-packages/ldap/functions.py", line 133, in set_option
   return _ldap_function_call(None,_ldap.set_option,option,invalue)
 File "/*xxx*/python2.7/site-packages/ldap/functions.py", line 64, in _ldap_function_call
   result = func(*args,**kwargs)
ValueError: option error
like image 542
Nelson Marcos Avatar asked Jan 22 '15 17:01

Nelson Marcos


1 Answers

got around this by installing openldap threw brew, and then manually downloading the tarball, and mod setup.cfg to pick up /usr/local, and then install.

http://sourceforge.net/p/python-ldap/bugs/65/ is the ticket to add /usr/local to the defaults on python-ldap.

like image 53
Axel Hecht Avatar answered Oct 02 '22 20:10

Axel Hecht