Skip to content

ValueError exception trying to set_option OPT_X_TLS_CACERTFILE in Mac OS #301

@shubb30

Description

@shubb30

Mac OS 10.14.6
Python 3.7.2
python-ldap 3.2.0

Issue description:

On Mac OS, trying to set the OPT_X_TLS_CACERTFILE option raises a ValueError.

Steps to reproduce:

$ python
Python 3.7.2 (default, Feb 12 2019, 08:16:38)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ldap
>>> l = ldap.initialize("ldaps://server")
>>> l.set_option(ldap.OPT_X_TLS_CACERTFILE, "/path/to/file")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/site-packages/ldap/ldapobject.py", line 921, in set_option
    return self._ldap_call(self._l.set_option,option,invalue)
  File "/usr/local/lib/python3.7/site-packages/ldap/ldapobject.py", line 315, in _ldap_call
    result = func(*args,**kwargs)
ValueError: option error
>>>

Doing the same thing in a Docker container running Python 3.7.3 does not have the problem.

# python
Python 3.7.3 (default, Mar 27 2019, 23:51:31)
[GCC 6.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ldap
>>> l = ldap.initialize("ldaps://server")
>>> l.set_option(ldap.OPT_X_TLS_CACERTFILE, "/path/to/file")
>>>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions