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

Michael Ströder michael at stroeder.com
Tue Feb 9 06:59:26 EST 2016


Jephte Clain wrote:
> Le 09/02/2016 13:03, Michael Ströder a écrit :
>>
>> Note that python-ldap's tracing only logs the Python API calls.
>>
>> In this particular case it'd be more helpful to enable libldap's own logging
>> like this:
>>
>> ldap.set_option(ldap.OPT_DEBUG_LEVEL,255)
>> ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, CACERTFILE)
> 
> when debugging is enabled this way, where are the log written?

Good question.

> I guess stderr

Yes. Note that with OpenLDAP command-line tools you use -d to specify the same
debug level and redirecting stderr to /dev/null suppresses the debug log on the
console:

ldapsearch -d 255 [..some args..] > /dev/null

> but I didn't find the info in the docs.

Hmm, I tried to find some information in the OpenLDAP man pages but there seems
to be none.

> Is it possible to choose another fd to write the logs to?

I don't think so.

Ciao, Michael.

-------------- 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/20160209/5562a172/attachment.bin>


More information about the python-ldap mailing list