激活 ldaps 支持,获取特定于实现的错误

激活 ldaps 支持,获取特定于实现的错误

系统:Ubuntu 16.04,运行 OpenLDAP 2.4.42

我正在关注教程配置 OpenLDAP 以使用 TLS。我最终创建的 LDIF 文件如下:

dn: cn=config
changetype: modify
replace: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/ssl/certs/cacert.pem
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ssl/private/mysite_slapd_key.pem
-
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ssl/certs/mysite_slapd_cert.pem

问题是,当我运行时sudo ldapmodify -H ldapi:/// -Y EXTERNAL -f myFile.ldif,出现以下错误:

$ sudo ldapmodify -H ldapi:/// -Y EXTERNAL -f myFile.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"
ldap_modify: Other (e.g., implementation specific) error (80)

我在 Google 上搜索过这个问题,偶然发现了此服务器故障帖子。我已经尝试了那里的答案中的所有方法,但仍然出现错误。

详细来说,它由所属的组/etc/ssl/certs/mysite_slapd_cert.pem拥有,就像 Ubuntu 页面上指定的说明一样。本质上,我已经运行了以下命令:ssl-certopenldap

sudo adduser openldap ssl-cert
sudo chgrp ssl-cert /etc/ssl/private/mysite_slapd_key.pem
sudo chmod g+r /etc/ssl/private/mysite_slapd_key.pem
sudo chmod o-r /etc/ssl/private/mysite_slapd_key.pem

下面是 slapd 在模式下运行时的输出-d 65(如另一个 serverfault 帖子的答案之一所建议的那样):

57c8c219 slap_listener_activate(8):
57c8c219 >>> slap_listener(ldapi:///)
57c8c219 connection_get(15): got connid=1000
57c8c219 connection_read(15): checking for input on id=1000
ber_get_next
ber_get_next: tag 0x30 len 24 contents:
57c8c219 op tag 0x60, time 1472774681
ber_get_next
57c8c219 conn=1000 op=0 do_bind
ber_scanf fmt ({imt) ber:
ber_scanf fmt ({m) ber:
ber_scanf fmt (m) ber:
ber_scanf fmt (}}) ber:
57c8c219 >>> dnPrettyNormal: <>
57c8c219 <<< dnPrettyNormal: <>, <>
57c8c219 do_bind: dn () SASL mech EXTERNAL
57c8c219 ==>slap_sasl2dn: converting SASL name gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth to a DN
57c8c219 <==slap_sasl2dn: Converted SASL name to <nothing>
57c8c219 SASL Authorize [conn=1000]:  proxy authorization allowed authzDN=""
57c8c219 send_ldap_sasl: err=0 len=-1
57c8c219 do_bind: SASL/EXTERNAL bind: dn="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" sasl_ssf=0
57c8c219 send_ldap_response: msgid=1 tag=97 err=0
ber_flush2: 14 bytes to sd 15
57c8c219 <== slap_sasl_bind: rc=0
57c8c219 connection_get(15): got connid=1000
57c8c219 connection_read(15): checking for input on id=1000
ber_get_next
ber_get_next: tag 0x30 len 245 contents:
57c8c219 op tag 0x66, time 1472774681
ber_get_next
57c8c219 conn=1000 op=1 do_modify
ber_scanf fmt ({m) ber:
ber_scanf fmt ({e{m[W]}}) ber:
ber_scanf fmt ({e{m[W]}}) ber:
ber_scanf fmt ({e{m[W]}}) ber:
57c8c219 >>> dnPrettyNormal: <cn=config>
57c8c219 <<< dnPrettyNormal: <cn=config>, <cn=config>
57c8c219 oc_check_required entry (cn=config), objectClass "olcGlobal"
57c8c219 oc_check_allowed type "objectClass"
57c8c219 oc_check_allowed type "cn"
57c8c219 oc_check_allowed type "olcArgsFile"
57c8c219 oc_check_allowed type "olcLogLevel"
57c8c219 oc_check_allowed type "olcPidFile"
57c8c219 oc_check_allowed type "olcToolThreads"
57c8c219 oc_check_allowed type "structuralObjectClass"
57c8c219 oc_check_allowed type "entryUUID"
57c8c219 oc_check_allowed type "creatorsName"
57c8c219 oc_check_allowed type "createTimestamp"
57c8c219 oc_check_allowed type "olcTLSCACertificateFile"
57c8c219 oc_check_allowed type "olcTLSCertificateKeyFile"
57c8c219 oc_check_allowed type "olcTLSCertificateFile"
57c8c219 oc_check_allowed type "entryCSN"
57c8c219 oc_check_allowed type "modifiersName"
57c8c219 oc_check_allowed type "modifyTimestamp"
57c8c219 send_ldap_result: conn=1000 op=1 p=3
57c8c219 send_ldap_response: msgid=2 tag=103 err=80
ber_flush2: 14 bytes to sd 15
57c8c219 connection_get(15): got connid=1000
57c8c219 connection_read(15): checking for input on id=1000
ber_get_next
ber_get_next: tag 0x30 len 5 contents:
57c8c219 op tag 0x42, time 1472774681
ber_get_next
57c8c219 conn=1000 op=2 do_unbind
57c8c219 connection_close: conn=1000 sd=15

相关内容