CFLDAP Error: One or more of the required attributes may be missing or incorrect or you do not ...
One of the Coldfusion applications I manage is currently making simple LDAP Binds to a Domain Controller over port 389. This is bad as it is sending credentials in cleartext, so I am trying to update the cfldap tag to make a secure connection over port 636. This currently looks something like the following:
<cfldap
action="QUERY"
name="ldap_query"
attributes="#variables.attributes#"
start="#variables.start#"
scope="SUBTREE"
maxrows="20"
filter="(sAMAccountName=#arguments.theUsername#)"
server="#variables.ldapServer#"
port="636"
username="#arguments.theUsername#"
password="#arguments.thePassword#"
secure="CFSSL_BASIC">
I'm getting the following error:
Detail: One or more of the required attributes may be missing or incorrect or you do not have permissions to execute this operation on the server.
Message: An error has occurred while trying to execute query :<servername>:636.
I found the following within the cfldap docs:
If you use the security="CFSSL_BASIC" option, ColdFusion determines whether to trust the server by comparing the server's certificate with the information in the jre/lib/security/cacerts keystore of the JRE used by ColdFusion. The ColdFusion default cacerts file contains information about many certificate granting authorities. If you must update the file with additional information, you can use the keytool utility in the ColdFusion jre/bin directory to import certificates that are in X.509 format.
Thinking this might be the issue, I imported the certificate into the cacerts keystore as suggested above and restrarted Coldfusion, but I am still getting the same error.
Just FYI, I do not have any control over the DC, however my client does and I am currently working with them to resolve this, but they don't have any CF experience -- they have the LDAP experience that I lack. I believe this issue is likely on the CF side of things since I get the same error when I try to connect to a different DC (that uses the same cert).
