3

我正在尝试在初始化结构 CA 服务器后注册管理员:

 fabric-ca-server init -b “admin:adminpw”

并使用以下命令启动 CA 服务器:

fabric-ca-server start -b “admin:adminpw”

在客户端,注册命令:

fabric-ca-client enroll -u http://admin:adminpw@localhost:7054

客户端错误信息:

[INFO] generating key: &{A:ecdsa S:256}
[INFO] encoded CSR
Error: Response from server: Error Code: 20 - Authorization failure

服务器端:

fabric-ca-server start -b “admin:adminpw”
2018/08/27 14:48:57 [INFO] Configuration file location: 
/home/nadeem/Documents/Fabric-CA/server/fabric-ca-server-config.yaml
2018/08/27 14:48:57 [INFO] Starting server in home directory: 
/home/nadeem/Documents/Fabric-CA/server
2018/08/27 14:48:57 [INFO] Server Version: 1.2.1-snapshot-3bcdbb2
2018/08/27 14:48:57 [INFO] Server Levels: &{Identity:1 Affiliation:1 
Certificate:1 Credential:1 RAInfo:1 Nonce:1}
2018/08/27 14:48:57 [INFO] The CA key and certificate already exist
2018/08/27 14:48:57 [INFO] The key is stored by BCCSP provider 'SW'
2018/08/27 14:48:57 [INFO] The certificate is at: 
/home/nadeem/Documents/Fabric-CA/server/ca-cert.pem
2018/08/27 14:48:57 [INFO] Initialized sqlite3 database at 
/home/nadeem/Documents/Fabric-CA/server/fabric-ca-server.db
2018/08/27 14:48:57 [INFO] Home directory for default CA: 
/home/nadeem/Documents/Fabric-CA/server
2018/08/27 14:48:57 [INFO] Listening on http://0.0.0.0:7054
***2018/08/27 14:49:34 [INFO] 127.0.0.1:46350 POST /enroll 401 23 "Failed 
to get user: : scode: 404, code: 63, msg: Failed to get User: sql: no 
rows in result set"***

结构 CA 客户端/服务器:

版本:1.2.1-snapshot-3bcdbb2 Go 版本:go1.11 操作系统/Arch:linux/amd64

在这里找到类似的帖子:

https://jira.hyperledger.org/browse/FABC-302

它用 v1.2 标记为已解决,但现在没有关于如何解决它的明确说明。谢谢 :)

4

4 回答 4

0

出现此错误消息。ca启动时和使用ca注册时的帐号和密码不一样。

于 2018-08-30T12:22:22.977 回答
0

我一直在尝试让 Fabric-CA 工作一段时间,我能给你的最好建议是在开始之前去掉管理员凭据周围的“”。我不放它们,它对我有用。所以命令将是:

fabric-ca-server init -b admin:adminpw

fabric-ca-server start -b admin:adminpw
于 2018-08-27T12:07:51.987 回答
0

可能在初始化期间。在您的 fabric-ca-server-config.yaml 文件中查找这些引号并将它们删除。不要在初始化注册期间使用它们。

fabric-ca-server-config.yaml 文件的图像

于 2020-10-30T17:51:14.617 回答
0

错误代码:20 - 授权失败

错误代码 20 由于以下情况而出现。假设您已经注册了这样的身份:-

fabric-ca-client  register --id.name org1 --id.type client --id.affiliation org1 --id.attrs '"hf.Registrar.Roles=user,client,peer","hf.AffiliationMgr=true","hf.Revoker=true"'

这是给你的输出

2020/02/05 11:19:25 [INFO] Configuration file location: /home/username/myPros/caclient/admin/fabric-ca-client-config.yaml
Password: ZXCbhJajCObX

并且您正在尝试像这样注册用户/身份:-

fabric-ca-client enroll -u http://org1-admin:ZXCbhJajCObX@localhost:7054

或者

fabric-ca-client enroll -u http://org1-admin:adminpw@localhost:7054

长话短说,您的注册 ID 或密码不匹配。确保您的用户名和密码不匹配。

于 2020-02-05T06:08:27.540 回答