I came here to find a solution to my problem with this. This Q&A did not solve my exact problem, but others looking for my exact solution to the problem will find the following useful:
For those who use SSL / TLS for basic transport encryption and not for authentication (self-signed certificates), you simply disable strict server certificate verification:
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW)
This is approximately the same as setting up the OpenLDAP 2.1+ client:
tls_checkpeer no
jblaine
source share