如果 ssl 打开,Apache mod auth_ldap 将无法工作

标签 apache authentication ssl openldap

这是完整的故事,下面有详细信息,如果有任何建议,我将不胜感激。

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

openssl s_client -connect openldapserverIP:636 -showcerts

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

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

<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)

提前致谢!

最佳答案

你需要使用

LDAPVerifyServerCert Off

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

关于如果 ssl 打开,Apache mod auth_ldap 将无法工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36043522/

相关文章:

javascript - 在浏览器环境中,是否可以在 JavaScript 中获取 SSL 证书列表?

php - Wamp 服务器显示语法错误但没有任何实际错误

css - 无法在 Apache 2.2 中显示 CSS 背景图片

apache - 重写规则而不更改浏览器中的 URL

java - 安卓 Ant 构建

php - 如何在mySQL中存储加密数据

python - 使用 django-cas 和 django-mama-cas 设置单点登录

php - 我的 Apache 2.4.9(Win32?)上是否禁用了 SSLv3?

php - Laravel 策略忽略查看、更新和删除,但创建工作正常

web-applications - Firefox Webapp(Open Web App)无法使用自签名证书