大网数据广告活动
服务器运维问答

OpenLDAP TLS CA configuration

· 52CE 我爱测

I'm currently in the process of setting up two sychronized OpenLDAP servers, access through starttls/ldaps. On the client/slave, I had problems with the TLS connection. I'm using the directory-based configuration, and olcTLSCACer…

问题原文

原帖链接 · twobeers · CC BY-SA 3.0

I'm currently in the process of setting up two sychronized OpenLDAP servers, access through starttls/ldaps. On the client/slave, I had problems with the TLS connection. I'm using the directory-based configuration, and olcTLSCACertificateFile: /etc/ssl/certs/root-ca.pem is set, root-ca.pem is readable for user ldap.

However, starttls and ldaps connection fail:

ldapwhoami -x -H ldap://192.168.56.201/ -ZZ
ldap_start_tls: Connect error (-11)
    additional info: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (unable to get local issuer certificate)

If I add a ldaprc file to the current directory with the following entry

TLS_CACERT /etc/ssl/certs/root-ca.pem

everthing works as expected.

So it seems the olcTLSCACertificateFile setting is being ignored, or could there be any other errors / misconfigurations I'm missing? OS is Suse Enterprise 11sp4, OpenLDAP version is 2.4.26

已采纳解答

原帖链接 · Wraezor Sharp · CC BY-SA 3.0

ldapwhoami is an LDAP client tool. It does not use the olcTLSCACertificateFile parameter. That is a server-side paramater for slapd.

You need to specify somewhere, that the client tools understand, that you trust the CA. This can be done (as you have done) in the ldaprc file, in the global /etc/ldap/ldap.conf file, by being overly permissive in your CA checking (TLS_REQCERT allow ...not recommended), or maybe the best option is to add your CA to be trusted by the system itself by doing this (on Debian at least, ymmv):

  1. Copy your (PEM-encoded) CA certificate to /usr/local/share/ca-certificates on the client machine.
  2. Run # update-ca-certificates
  3. This will update the /etc/ssl/certs/ca-certificates.crt collection of CAs, which should already be specified in your /etc/ldap/ldap.conf file and your CA will be trusted by ldapwhoami and other tools.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-05-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。