使用Fabric CA Client

时间:2017-12-19 07:40:22

标签: hyperledger-fabric

我通过以下教程准备了具有Fabric CA环境的多组织。本教程本身没有问题。

  

将Hyperledger Composer区块链业务网络部署到Hyperledger Fabric(多个   组织)
  https://hyperledger.github.io/composer/unstable/tutorials/deploy-to-fabric-multi-org.html

在此环境中,我在ca_peerOrg1和主机环境中尝试Fabric CA客户端命令。我从crypto-config / ordererOrganizations / example.com / orderer / orderer.example.com /复制了tls crt,公钥和私钥,并尝试了以下命令,但我得到了错误" x509:证书对ca. org1.example.com,而不是localhost"。

linux1@fabric:~$ fabric-ca-client enroll --caname ca-org1 --tls.certfiles ca.crt --tls.client.certfile Admin@org1.example.com-cert.pem --tls.client.keyfile 0dbfd9d156b90331e6bc4a0529e07cb123f7de586935019499623062f182a8fa_sk -u https://admin:adminpw@localhost:7054
2017/12/19 16:34:35 [INFO] User provided config file: /home/linux1/fabric-ca/clients/admin/fabric-ca-client-config.yaml
2017/12/19 16:34:35 [INFO] generating key: &{A:ecdsa S:256}
2017/12/19 16:34:35 [INFO] encoded CSR
2017/12/19 16:34:35 [INFO] TLS Enabled
Error: POST failure [Post https://localhost:7054/enroll: x509: certificate is valid for ca.org1.example.com, not localhost]; not sending
POST https://localhost:7054/enroll
Authorization: Basic YWRtaW46YWRtaW5wdw==
{"hosts":["fabric"],"certificate_request":"-----BEGIN CERTIFICATE REQUEST-----\nMIIBOzCB4wIBADBdMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xp\nbmExFDASBgNVBAoTC0h5cGVybGVkZ2VyMQ8wDQYDVQQLEwZGYWJyaWMxDjAMBgNV\nBAMTBWFkbWluMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEI8Y4aR/YxeyMXIQ3\nHGydrTLaoI+6tZ57ho1uv6gNonbFfftE7lrdsIbL8d8QLimztDjtqkg6rk612nso\nD66M9aAkMCIGCSqGSIb3DQEJDjEVMBMwEQYDVR0RBAowCIIGZmFicmljMAoGCCqG\nSM49BAMCA0cAMEQCIH9u2w9xO43Ba5rJ1SCKgtEFfokj1DKhg2cHjnbu8ucEAiBn\nwZKjjSbQage+ElofYbgagWpuCFz0t57Zwycz22M00w==\n-----END CERTIFICATE REQUEST-----\n","profile":"","crl_override":"","label":"","CAName":"ca-org1"}
linux1@fabric:~$

如何避免此错误?当我查看教程时,我意识到作曲家连接配置文件的配置类似于" hostnameOverride":" ca.org1.example.com"。我想我需要为fabric-ca-client做同样的事情。

0 个答案:

没有答案