fabric-ca 登记身份时报Error: Response from server: Error Code: 20 - Authentication failure

1、使用fabric-ca登记身份时,命令如下:

sudo fabric-ca-client enroll -u http://peer1:peer1pw@localhost:7054 -M $FABRIC_CA_CLIENT_HOME/msp

2、报了一个错,错误信息如下:

2021/03/03 15:21:38 [INFO] generating key: &{A:ecdsa S:256}
2021/03/03 15:21:38 [INFO] encoded CSR
Error: Response from server: Error Code: 20 - Authentication failure

并且在fabric-ca-server底下还会报如下错误:

3、解决办法,要在fabric-ca-server-config.yaml底下加上对应的name为peer1配置,即如下面所示:

registry:
  # Maximum number of times a password/secret can be reused for enrollment
  # (default: -1, which means there is no limit)
  maxenrollments: -1

  # Contains identity information which is used when LDAP is disabled
  identities:
     - name: admin
       pass: adminpw
       type: client
       affiliation: ""
       attrs:
          hf.Registrar.Roles: "*"
          hf.Registrar.DelegateRoles: "*"
          hf.Revoker: true
          hf.IntermediateCA: true
          hf.GenCRL: true
          hf.Registrar.Attributes: "*"
          hf.AffiliationMgr: true
     - name: peer1
       pass: peer1pw
       type: client
       affiliation: ""
       attrs:
          hf.Registrar.Roles: "*"
          hf.Registrar.DelegateRoles: "*"
          hf.Revoker: true
          hf.IntermediateCA: true
          hf.GenCRL: true
          hf.Registrar.Attributes: "*"
          hf.AffiliationMgr: true

4、接着,再重新启动fabric-ca-server,输入命令:

sudo fabric-ca-server start -b admin:adminpw

5、再重新执行下命令,登记peer1身份:

sudo fabric-ca-client enroll -u http://peer1:peer1pw@localhost:7054 -M $FABRIC_CA_CLIENT_HOME/msp

如下图所示便成功了:

6、fabric-ca-server所启动的终端窗口,也会显示对应的输入日志,如下图所示:

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值