You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

LDAP服务器连接失败问题求助:PHP应用及ldapsearch均无法连接,openssl调试异常

LDAP服务器连接失败问题求助:PHP应用及ldapsearch均无法连接,openssl调试异常

各位大佬好,我遇到了一个LDAP连接的棘手问题,折腾好久都没解决,想请大家帮忙看看!

环境信息

  • 运行环境:RedHat系统 + Apache服务器 + PHP应用(SELinux已禁用)

遇到的错误

  1. PHP应用连接报错:Apache日志中出现以下错误

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

  1. 命令行工具报错:手动执行ldapsearch命令时,同样报错

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

调试操作及结果

我尝试用openssl命令排查SSL连接问题,执行了:

openssl s_client -connect xx.com:636 -debug

得到的输出结果如下:

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)

已排查的情况

  • 防火墙:已经开放了636端口,排除防火墙拦截的可能
  • LDAP配置文件:/etc/openldap/ldap.conf已正确配置,文件中指定的证书存在且权限设置正确

现在我有点摸不着头绪,有没有大佬遇到过类似的问题?希望能得到大家的帮助,谢谢!

备注:内容来源于stack exchange,提问作者el sparrow

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.21 15:34:34