Fix ldap in secure mode