Score:0

Cannot connect to LDAP server ERRNO=0

cw flag

I have a php application (apache,redhat with selinux disabled) and I am struggling with ldap configuration. I am trying to connect to a ldap server and I am getting this error in apache logs:

ldap_bind(): Unable to bind to server: Can't contact LDAP server

when running ldapsearch command : I also get this error:

ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)

I tried to debug and used openssl command : openssl s_client -connect xx.com:636 -debug and get this :

CONNECTED(00000003)
write:errno=0
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 322 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)
---
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 322 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)

Has someone had the same issue? I thought it could be the firewall but I opened port 636 so I don't think that is the problem. The /etc/openldap/ldap.conf is also configured and the certificate is mentionned in the file and does exist with the correct rights so I am not sure it would be the certificate either..I am a bit lost. Any help is appreciated. Thanks

user1686 avatar
fr flag
Are you the one who's running the LDAP server in question? If so, have you checked its logs?
ws flag
There is no TLS running here. If you shared the configuration you might get some help, meanwhile try getting it working on port 389 / no TLS.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.