I have been trying to configure SASL External over LDAPS (Port 636). Below things are already in place.
- Have enforced the LDAP (aka AD server 2019) for LDAP signing and Binding via Domain Controllers Group Policy.
- Have a User Certificate issued by its Enterprise CA configured with User DN (cn=testuser,cn=users,dc=dummydomain,dc=test) in Subject and SAN (cn=testuser,cn=users,dc=dummydomain,dc=test), SAN also includes the UPN (******@dummydomain.test) and the certificates are uploaded to active directory. The certificate extension uses Client Authentication
- Client and the server are trusting the CA which have issued the cert for the LDAPS server certificate and the User certificate
- Have a linux server in place with OpenLDAP client installed.
The .ldaprc has the below settings:
TLS_REQCERT hard
TLS_CACERT /etc/openldap/cacerts/caroot.pem
TLS_CERT /etc/openldap/certs/usercert.pem
TLS_KEY /etc/openldap/certs/private.key
SASL_MECH external
TLS_PROTOCOL_MIN 1.2
Below works successfully on port 389 with LDAP (START-TLS):
Command:
ldapwhoami -Y EXTERNAL -H ldap://server.dummydomain.test -Z
Results of above command:
SASL/EXTERNAL authentication started
SASL username: cn=testuser,cn=users,dc=dummydomain,dc=test
SASL SSF: 0
u:DUMMYDOMAIN\testuser
Using the same with LDAPS on port 636 doesn't work at all and gives the below error.
Command:
ldapwhoami -Y EXTERNAL -H ldaps://server.dummydomain.test
Results of above command:
SASL/EXTERNAL authentication started
ldap_sasl_interactive_bind_s: Authentication method not supported (7)
additional info: 00002027: LdapErr: DSID-0C0905F0, comment: Invalid Authentication method, data 0, v4563
Have searched with DSID for any references on error and I was not able to find any resolution or references on the same.
I wonder what is the difference and why SASL-EXTERNAL works fine on port 389 with START-TLS and refuses to work on port 636 with the error stated above.
The debug logs also don't provide much information:
*host: server.dummydomain.test port: 636 (default)
refcnt: 2 status: Connected
last used: Tue Sep 13 11:14:09 2022
ld 0x55c987e4e3c0 Outstanding Requests:
msgid 1, origid 1, status InProgress
outstanding referrals 0, parent count 0
ld 0x55c987e4e3c0 request count 1 (abandoned 0)
** ld 0x55c987e4e3c0 Response Queue:
Empty
ld 0x55c987e4e3c0 response count 0
ldap_chkResponseList ld 0x55c987e4e3c0 msgid 1 all 1
ldap_chkResponseList returns ld 0x55c987e4e3c0 NULL
ldap_int_select
read1msg: ld 0x55c987e4e3c0 msgid 1 all 1
ber_get_next
ber_get_next: tag 0x30 len 104 contents:
read1msg: ld 0x55c987e4e3c0 msgid 1 message type bind
ber_scanf fmt ({eAA) ber:
read1msg: ld 0x55c987e4e3c0 0 new referrals
read1msg: mark request completed, ld 0x55c987e4e3c0 msgid 1
request done: ld 0x55c987e4e3c0 msgid 1
res_errno: 7, res_error: <00002027: LdapErr: DSID-0C0905F0, comment: Invalid Authentication method, data 0, v4563>, res_matched: <>
ldap_free_request (origid 1, msgid 1)
ldap_int_sasl_bind: EXTERNAL
ldap_parse_sasl_bind_result
ber_scanf fmt ({eAA) ber:
ldap_parse_result
ber_scanf fmt ({iAA) ber:
ber_scanf fmt (}) ber:
ldap_msgfree
ldap_err2string
ldap_sasl_interactive_bind_s: Authentication method not supported (7)
additional info: 00002027: LdapErr: DSID-0C0905F0, comment: Invalid Authentication method, data 0, v4563
ldap_free_connection 1 1
ldap_send_unbind
ber_flush2: 7 bytes to sd 3
TLS trace: SSL3 alert write:warning:close notify
ldap_free_connection: actually freed*
Any help on getting this worked is much appreciated. Thanks in anticipation.