0
votes

In my code I am using openldap library to start tls to a ldap server. Using global LDAP_OPT_X_TLS_CACERTDIR option to set ca certificate directory. ldap_set_option(NULL, LDAP_OPT_X_TLS_CACERTDIR,"");

Now, STEP 1 : Correct certificate is in place and ldap_sasl_bind_sto ldap server is successful (as expected).

STEP 2 : I am deleting the certificate from the directory as I don't want openldap to use the older certificate, but even after this the bind is getting successful.

If the certificate is loaded in openldap's cache, I am not able to find any way to reset it.

My problem is exactly same as : starttls successful even after deleting CA from the ca dir

1

1 Answers

0
votes

Found the solution by reinitializing the TLS Context.

int is_server = 0; ldap_set_option(NULL, LDAP_OPT_X_TLS_NEWCTX, &is_server);