繁体   English   中英

Subversion Apache2.2 LDAPS 认证失败

[英]Subversion Apache2.2 LDAPS authentication failed

操作系统:Redhat Linux 颠覆:1.5.0 Apache:2.2.17

httpd.conf:

LDAPSharedCacheSize 200000
LDAPCacheEntries 1024
LDAPCacheTTL 600
LDAPOpCacheEntries 1024
LDAPOpCacheTTL 600

<Location /svn>
DAV svn
SVNParentPath /home/svnroot/repository
AuthzSVNAccessFile /home/svnroot/repository/svn_access_file
AuthType Basic
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
AuthLDAPURL "ldaps://master.ldap.ebupt.com:636/OU=staff,DC=ebupt,DC=com?uid?sub?(objectClass=*)" SS
L
AuthName "Subversion.resository"
Require valid-user
</Location>

Apache 错误日志:

[Thu Feb 24 16:48:00 2011] [debug] mod_authnz_ldap.c(403): [client 10.1.85.181] [25242] auth_ldap a
uthenticate: using URL ldaps://master.ldap.ebupt.com:636/OU=staff,DC=ebupt,DC=com?uid?sub?(objectCl
ass=*)
[Thu Feb 24 16:48:00 2011] [info] [client 10.1.85.181] [25242] auth_ldap authenticate: user jinjian
kang authentication failed; URI /svn [LDAP: ldap_simple_bind_s() failed][Can't contact LDAP server]

ping master.ldap.ebupt.com 没问题。

我的 FTP LDAPS 身份验证正常,如下所示:

server:master.ldap.ebupt.com
port:636
Enable SSL:checked
Base DN:ou=staff,dc=ebupt,dc=com
anonymous:checked
Search Filter:(objectClass=*)
User DN attribute:uid
Search scope:subtree

“无法联系 LDAP 服务器”可能意味着很多事情,但是如果您的 LDAP 服务器可以访问并且您在此处使用的是 SSL 上的简单绑定,则意味着 Apache 不信任 LDAP 服务器提供的证书.

您需要将证书告知 Apache,以便它可以创建 SSL 连接。

Apache 文档的这一部分是您所需要的: http : //httpd.apache.org/docs/2.2/mod/mod_ldap.html#usingssltls

执行此操作的最佳方法是从在 LDAP 服务器上签署证书的 CA 获取 CA 证书,并使用 LDAPTrustedGlobalCert 指令。 一个例子,来自我的一个盒子:

LDAPTrustedGlobalCert CERT_BASE64 /etc/openldap/cacerts/cacert.pem

获取 CA 证书的方式各不相同; 我的 LDAP 服务器正在运行由我们自己的 CA 签名的证书,因此我可以轻松获得 CA 证书。 您的设置可能有所不同; 请咨询负责您的 LDAP 服务器的人员。

您还可以使用 OpenSSL 工具获取 LDAP 服务器提供的证书:

openssl s_client -connect your.ldap.host:636 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'

那将显示证书。 将所有内容(包括 BEGIN CERTIFICATE 和 END CERTIFICATE)复制到一个文件中。

现在添加指令:

LDAPTrustedGlobalCert CERT_BASE64 /path/to/your/cert/file

到 Apache 配置的顶部。 重新启动Apache,你就完成了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM