![錯誤:無法啟動 TLS。請檢查您的 LDAP 伺服器配置。在 PhpLdapAdmin 上](https://rvso.com/image/770094/%E9%8C%AF%E8%AA%A4%EF%BC%9A%E7%84%A1%E6%B3%95%E5%95%9F%E5%8B%95%20TLS%E3%80%82%E8%AB%8B%E6%AA%A2%E6%9F%A5%E6%82%A8%E7%9A%84%20LDAP%20%E4%BC%BA%E6%9C%8D%E5%99%A8%E9%85%8D%E7%BD%AE%E3%80%82%E5%9C%A8%20PhpLdapAdmin%20%E4%B8%8A.png)
我們有一個 LDAP 伺服器,我們使用 phpldapadmin 來管理它。我已經很久沒有使用它了,當我嘗試使用管理員用戶登入時,我得到以下資訊:
Could not start TLS. (LDAP Server)
Error: Could not start TLS. Please check your LDAP server configuration.
error Unable to connect to LDAP server LDAP Server
Error: Can't contact LDAP server (-1) for user
error Failed to Authenticate to server
Invalid Username or Password.
LDAP 伺服器運作正常,我還驗證了使用者的密碼,它是正確的。我可以使用該使用者在命令列上的伺服器上進行 ldapsearch。
我最近在這台伺服器上唯一改變的是一些 iptables 規則。它曾經工作得很好,所以我不太明白問題出在哪裡。我們使用 Let's Encrypt 憑證連接到 LDAP 伺服器。伺服器在 Debian 9 下,phpldapadmin 使用 nginx。
編輯
我已將 PLA 日誌置於調試模式,但沒有獲得比以前更多的資訊。 Nginx 的日誌中也沒有給我任何錯誤。我嘗試過以下命令:
ldapsearch -ZZ -H ldap://ldap.mydomain.com -W -D cn=adminuser,dc=mydomain,dc=com -b dc=mydomain,dc=com
而且效果很好。也可以使用以下命令檢查 ssl 連線:
openssl s_client -connect ldap.mydomain.com:636
返回證書。
我不知道PLA是否可以讀取ldap.conf
答案1
解決方案是如此簡單,我什至無法思考。我重新啟動 php7.0-fpm 並解決了問題。