Has anyone been able to use the C API LDAP functions to connect to an LDAP server over SSL?
I’m trying to update some code I have that currently connects with no encryption to use SSL.
I have tried setting the option LDAP_OPT_SSL to LDAP_OPT_ON then doing a ldap_sasl_bind_s with LDAP_SSL_EXTERNAL as the method, but it will not bind. Doing an LDAP_BIND_S also did not work.
I can use the ldapsearch utility to connect on port 636, so I know the LDAP server is set up correctly and that I have the correct SSL cert in my keyring.
If all you want to do is open an ssl encrypted channel to the LDAP server, authenticate with a simple username/password, and perform some other ldap requests over this encrypted connection, then the following code snippet should serve as a good example (I haven’t compiled it, but it should be pretty close).