是否有人成功使用 openldap
服务器配置了 Fabric-CA(1.2.0-stable)
服务器?
我在日志中看到此错误:
2018/09/03 01:34:01 [DEBUG] Creating new LDAP client for { Enabled:true URL:ldap://****:****@openldap/dc=example,dc=com UserFilter:(uid=%s) GroupFilter:(memberUid=%s) Attribute:{[uid member][{ }] map[groups:[{ }]]} TLS:{false [] { }} }
2018/09/03 01:34:01 [DEBUG] Initialized LDAP identity registry; err=Invalid expression for attribute '': Unexpected end of expression
2018/09/03 01:34:01 [WARNING] Failed to initialize LDAP client; err=Invalid expression for attribute '': Unexpected end of expression
2018/09/03 01:34:01 [ERROR] Error occurred initializing database: Invalid expression for attribute '': Unexpected end of expression
这是我用来启动openldap
的命令:
docker run -h openldap -p 389:389 --name openldap --network=fabric-n --volume /home/xxxx/fabric-ca/data:/etc/hyperledger --env LDAP_ORGANISATION="Hyperledger" --env LDAP_DOMAIN="example.com" --env LDAP_ADMIN_PASSWORD="adminpw" --detach osixia/openldap:1.2.1
这是运行fabricca
的命令:
docker run -h fabric-ca -p 7054:7054 --name fabric-ca --network=fabric-n --volume /home/xxxx/fabric-ca/data:/etc/hyperledger --env FABRIC_CA_SERVER_HOME="/etc/hyperledger/fabric-ca-server" --env FABRIC_CA_CLIENT_HOME="/etc/hyperledger/fabric-ca-client" --env FABRIC_CA_SERVER_CA_NAME="hfca" --detach hyperledger/fabric-ca:amd64-1.2.0
我创建了一个可以连接到 openldap 容器的 docker 覆盖网络
fabric-ca-server-config.yaml
ldap:
# Enables or disables the LDAP client (default: false)
# If this is set to true, the "registry" section is ignored.
enabled: true
# The URL of the LDAP server
url: ldap://cn=admin,dc=example,dc=com:adminpw@openldap/dc=example,dc=com
最佳答案
此错误很可能是由于缺少 fabric-ca-server-config.yaml
文件中设置的 converters
属性而引起的。
默认情况下,在 ldap
部分中,converters
为空:
converters:
- name:
value:
并且当启用ldap
时,无法正确解析它,因此会引发错误。请在那里输入任何值,例如:
converters:
- name: hf.Revoker
value: attr("uid") =~ "revoker*"
关于ldap - 使用 openldap 配置 hyperledger Fabric-CA 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52142358/