[python-ldap] ValueError: option error on trying to set OPT_X_TLS_CACERTFILE

Michael Ströder michael at stroeder.com
Fri Feb 5 02:14:52 EST 2016

Peter Bengtsson wrote:
> I'm on OSX 10.11.3 and I installed python-ldap 2.4.25 with pip in a
> virtualenv. And I always get this error:
>>>> import ldap
>>>> ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, '/path/to.crt')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/Users/peterbe/virtualenvs/medlem/lib/python2.7/site-packages/python_ldap-2.4.25-py2.7-macosx-10.11-x86_64.egg/ldap/functions.py",
> line 133, in set_option
>     return _ldap_function_call(None,_ldap.set_option,option,invalue)
>   File
> "/Users/peterbe/virtualenvs/medlem/lib/python2.7/site-packages/python_ldap-2.4.25-py2.7-macosx-10.11-x86_64.egg/ldap/functions.py",
> line 64, in _ldap_function_call
>     result = func(*args,**kwargs)
> ValueError: option error

Most times this happens if the cert file does not exist.

> It doesn't matter what the value of that option is.
> It does not happen when installed on Ubuntu.


> Axel here, http://stackoverflow.com/a/29101851/205832 said he managed to
> make the problem go away by downloading the tarball and adding /usr/local
> to setup.cfg. That did not help for me.

That sounds like a strange solution to me. But I have no personal experience
with with Max OS X.

Ciao, Michael.

P.S.: Please subscribe to the low-traffic python-ldap mailing list. So all the
answers really reach you.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20160205/39021b5d/attachment.bin>

More information about the python-ldap mailing list