如果ssl打开,Apache mod auth_ldap将不起作用

问题描述 投票:3回答:2

这是完整的故事,详情如下,我很感激任何建议。

我有一个Web服务器,我需要使用ldap启用apache auth到某些资源。我也有openldap服务器,我可以通过身份验证。 openldap启用了端口389和636,并且在openldap上安装了自签名证书。 Web服务器配置了openldap客户端,可以识别ID用户。如果我使用此字符串测试从web服务器到openldap的连接:

openssl s_client -connect openldapserverIP:636 -showcerts

我得到了所有正确信息的回复。

在web服务器配置中我添加了这个:

<Directory /www/protect>
Order deny,allow
Deny from All
AuthName "identity"
AuthType Basic
AuthBasicProvider ldap
AuthLDAPBindAuthoritative off
AuthLDAPUrl ldap://openldapIP/ou=People,dc=mydomain,dc=org?uid
AuthLDAPBindDN "cn=ldapreadonlyuser,dc=mydomain,dc=org"
AuthLDAPBindPassword "somethinghere"
AuthLDAPGroupAttribute memberUid
Require ldap-attribute  myAttribute=800
Require ldap-attribute myAttribute=820
Satisfy any
LogLevel debug
</Directory>

它的工作原理。

然后,如果我启用安全连接,请将连接字符串更改为:

AuthLDAPUrl ldaps://openldapIP/ou=People,dc=mydomain,dc=org?uid TLS

要么

AuthLDAPUrl ldap://openldapIP:636/ou=People,dc=mydomain,dc=org?uid TLS

这是行不通的。

这是错误日志:

auth_ldap authenticate: user x authentication failed; URI / [LDAP: ldap_simple_bind() failed][Can't contact LDAP server] (not authoritative)

提前致谢!

apache authentication ssl openldap
2个回答
1
投票

你需要使用

LDAPVerifyServerCert Off

在Apache配置的全局级别。那是因为您的证书是自签名的。


0
投票

将您的CA证书和ldap服务器证书放在/etc/pki/mycerts/certs-bundle.pem中,并将参数LDAPTrustedGlobalCert CA_BASE64 /etc/pki/mycerts/certs-bundle.pem添加到您的httpd.conf中

© www.soinside.com 2019 - 2024. All rights reserved.