gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 12:53:16 25 4
gpt4 key购买 nike

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

我有一个 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com