Hi. I'm trying to use C code of your gitlab repository to make a program that can bind to remote LDAP server.
I have some problems with using self signed certificate in openldap server. When I try to connect to remote LDAP server with SSL connection,
ldap_sasl_bind_s return this error :
"Can't contact LDAP server (-1)
additional info: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed (self signed certificate in certificate chain) "
At the same time, server prints like this :
632973de conn=1018 fd=12 ACCEPT from IP=172.17.0.1:57250 (IP=0.0.0.0:636)
TLS: can't accept: A TLS fatal alert has been received..
632973de conn=1018 fd=12 closed (TLS negotiation failure)
I use docker image to build an openldap server for test and made my own CA certificates, server's private key and certificate for TLS connection.
On client program side, I set some options related to TLS connection. I set LDAP_OPT_X_TLS_REQUIRE_CERT to LDAP_OPT_X_TLS_NEVER, and set LDAP_OPT_X_TLS_CACERTDIR, LDAP_OPT_X_TLS_CACERTFILE to the path that server's CA certificate file is stored.
I think I set all options that I can do on client side, but client always verify server's certificate and return "certificate verify failed (self signed certificate in certificate chain)" this error. It is okay to bind without TLS negotiation on client program. Also I made a connection with the server using LDAPAdmin which is windows ldap client program and it makes TLS connection successfully. Is there other option or some codes to be executed to make a secure connection using self signed certificate? I've been struggling with this error for a couple of weeks and not able to find a solution. Can I make a TLS connection with the server that uses the self-signed certificate?