OpenLDAP SSL 错误

OpenLDAP SSL 错误

我确实设置了一个 OpenLDAP 服务器,并针对它进行了 PAM 身份验证。在明文中,它运行良好,但当我尝试添加 SSL 时,它总是失败。

我正在遵循该指南来让它发挥作用: http://kidrek.fr/blog/?p=30

我正在 Debian lenny 系统上执行此操作。在我的日志中我可以看到:9 月 9 日 17:00:48 主机名 slapd[3231]: connection_read(13): 检查 id=14 上的输入
9 月 9 日 17:00:48 主机名 slapd[3231]: connection_read(13): 无法获取 TLS 客户端 DN,错误=49 id=14
9 月 9 日 17:00:48 主机名 slapd[3231]: connection_get(13): 获得 connid=14
9 月 9 日 17:00:48 主机名 slapd[3231]: connection_read(13): 检查 id=14 上的输入
9 月 9 日 17:00:48 主机名 slapd[3231]: fd 13 上的 ber_get_next 失败 errno=0 (成功)
9 月 9 日 17:00:48 主机名slapd[3231]: connection_closing: 准备 conn=14 sd=13 关闭
9 月 9 日 17:00:48 主机名 slapd[3231]: connection_close: conn=14 sd=13

在客户端: 9 月 9 日 17:00:47 主机名 id:nss_ldap:无法搜索 LDAP 服务器 - 服务器不可用
9 月 9 日 17:00:47 主机名 id:nss_ldap:无法以 cn=admin、dc=company、dc=local 的身份连接到任何 LDAP 服务器 - 无法联系 LDAP 服务器
9 月 9 日 17:00:47 主机名 id:nss_ldap:无法绑定到 LDAP 服务器 ldaps://brublunm13.company.local/:无法联系 LDAP 服务器
9 月 9 日 17:00:47 主机名 id:nss_ldap:重新连接到 LDAP 服务器...
9 月 9 日 17:00:47 主机名 id:nss_ldap:无法以 cn=admin、dc=company、dc=local 的身份连接到任何 LDAP 服务器 - 无法联系 LDAP 服务器
9 月 9 日 17:00:47 主机名 id: nss_ldap:无法绑定到 LDAP 服务器 ldaps://brublunm13.company.local/:无法联系 LDAP 服务器
9 月 9 日 17:00:47 主机名 id:nss_ldap:重新连接到 LDAP 服务器(休眠 1 秒)...
9 月 9 日 17:00:48 主机名 id:nss_ldap:无法以 cn=admin、dc=company、dc=local 的身份连接到任何 LDAP 服务器 - 无法联系 LDAP 服务器 9 月 9 日 17:00:48 主机名 id:nss_ldap:无法绑定到 LDAP 服务器 ldaps://brublunm13.company.local/:无法联系 LDAP 服务器
9 月 9 日 17:00:48 主机名 id:nss_ldap:无法搜索 LDAP 服务器 - 服务器不可用

另外,在我的 slapd.conf 中我得到了:
TLSVerifyClient never

对此有什么想法吗?

提前致谢,

答案1

似乎您正在尝试使用客户端 SSL 而不是服务器端;客户端使用证书而不是密码来识别自己。

请注意,OpenLDAP SSL 实现相当棘手 - 我花了很长时间才弄清楚它是在放弃权限之后读取它的 SSL 证书,因此 SSL 证书需要具有 OpenLDAP 用户的读取权限...

答案2

我目前在 RHEL 上使用 SSL 与 OpenLDAP 协同工作 - 在我的 slapd.conf 中,我有:

TLSCACertificateFile /etc/openldap/cacerts/cacert.pem
TLSCertificateFile /etc/openldap/cacerts/slapdcert.pem
TLSCertificateKeyFile /etc/openldap/cacerts/slapdkey.pem

您可以使用:

openssl s_client -connect localhost:636 -showcerts

检查服务器证书是否已安装并正常工作,以及

ldapsearch -ZZ -x -D 'cn=manager,dc=domain,dc=com' -W 'objectclass=*' -v

检查 TLS 是否正常工作。

我主要参考了http://www.openldap.org/faq/data/cache/185.html用于获取证书生成并设置正确的权限。

相关内容