2

有人Fabric-CA (1.2.0-stable)用服务器成功配置openldap服务器吗?

我在日志中看到此错误:

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
4

1 回答 1

2

此错误很可能是由于文件中缺少 converters下面设置的属性而引起的fabric-ca-server-config.yaml。默认情况下,在ldapsection 中有converters哪些是空的:

      converters:
         - name:
           value:

并且当ldap启用时,它无法正确解析,因此会引发错误。请在此处输入任何值,例如:

      converters:
         - name: hf.Revoker
           value: attr("uid") =~ "revoker*"
于 2018-09-03T12:22:02.487 回答