首页 > 解决方案 > OpenLDAP:连接到 Active Directory 时出错

问题描述

我在正确运行 OpenLDAP 时遇到问题。

我希望从我的应用程序到 OpenLDAP 元目录的连接以及从 OpenLDAP 到实际活动目录的连接都加密。

从我的应用程序到 OpenLDAP 的连接工作正常。

但是,当为连接到 AD 分配的用户尝试在 AD 中搜索时,他会收到一个证书错误:

TLS certificate verification: Error, unable to get local issuer certificate
TLS: can't connect: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (unable to get local issuer certificate).

这是我的 slapd.conf 文件:

# MDB Backend configuration file
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
ucdata-path ./ucdata
include     ./schema/core.schema
include     ./schema/cosine.schema
include     ./schema/nis.schema
include     ./schema/inetorgperson.schema
#include        ./schema/openldap.schema
#include        ./schema/dyngroup.schema


pidfile     ./run/slapd.pid
argsfile    ./run/slapd.args

loglevel 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1
#loglevel 256

sizelimit unlimited
timelimit unlimited


# Enable TLS if port is defined for ldaps
#TLSCipherSuite HIGH:MEDIUM:-SSLv2:+SSLv3:RSA
TLSCipherSuite ALL
TLSCertificateFile C:/cert.crt
TLSCertificateKeyFile C:/certKey.pem
TLSCACertificateFile C:/certCA.cer
TLSVerifyClient try



#######################################################################
# mdb database definitions
#######################################################################


database meta
suffix "dc=example,dc=com"
rootdn      "cn=ldap-openLDAP,ou=Users,ou=example,dc=example,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
#rootpw    {SHA256}276396e1b1727dbb27f226ad31ed186c8baaf2ddfc3fc7c4120c5ff15524533b
rootpw  ]8+yI7t$#>tg23ET0V:Zry)m.p/@Cl]K^MFIw.0*

uri     "ldaps://firstAD.example.com:636/DC=example,DC=com"
idassert-bind bindmethod=simple binddn=CN=ldap-openLDAP,OU=Services,OU=example,DC=example,DC=com credentials=abcd mode=self
idassert-authzFrom "dn.regex:.*"

uri     "ldaps://secondAD.example2.com:636/DC=example2,DC=com"
idassert-bind bindmethod=simple binddn=CN=ldap_user,OU=LDAP,OU=Service_User,DC=example2,DC=com credentials=abcd mode=self
idassert-authzFrom "dn.regex:.*"

当我使用 ldap 和端口 389 而不是 ldaps 和端口 636 时,它工作正常。

知道如何让应该对 AD 服务器进行身份验证的两个用户可以通过 ldaps 进行操作吗?

重要信息:OpenLDAP 安装在 Windows 服务器上。

标签: sslopenldap

解决方案


推荐阅读