Hyperledger Composer:错误:无法请求身份。不受支持的证书用途

时间:2018-05-17 13:56:32

标签: hyperledger-fabric hyperledger hyperledger-composer

我正在关注Hyperledger作曲家教程(网址:https://hyperledger.github.io/composer/latest/tutorials/deploy-to-fabric-multi-org),用于将Hyperledger Composer区块链业务网络部署到Hyperledger Fabric(多个组织)。

执行命令时,我无法执行步骤15.

作曲家身份请求-c PeerAdmin @ byfn-network-org1 -u admin -s adminpw -d alice

我收到以下错误:

错误:未能请求身份。尝试注册用户并返回证书时出错。错误:调用注册端点失败,错误[错误:证书目的不受支持]

注意:CA服务器正在运行。

有人可以提出一个解决方法,让上面的命令执行吗?

请找到已编辑的问题。 我在connection.json文件下面添加了详细信息。

   {
        "name": "byfn-network",
        "x-type": "hlfv1",
        "version": "1.0.0",
        "channels": {
            "mychannel": {
                "orderers": [
                    "orderer.example.com"
                ],
                "peers": {
                    "peer0.org1.example.com": {
                        "endorsingPeer": true,
                        "chaincodeQuery": true,
                        "eventSource": true
                    },
                    "peer1.org1.example.com": {
                        "endorsingPeer": true,
                        "chaincodeQuery": true,
                        "eventSource": true
                    },
                    "peer0.org2.example.com": {
                        "endorsingPeer": true,
                        "chaincodeQuery": true,
                        "eventSource": true
                    },
                    "peer1.org2.example.com": {
                        "endorsingPeer": true,
                        "chaincodeQuery": true,
                        "eventSource": true
                    }
                }
            }
        },
        "organizations": {
            "Org1": {
                "mspid": "Org1MSP",
                "peers": [
                    "peer0.org1.example.com",
                    "peer1.org1.example.com"
                ],
                "certificateAuthorities": [
                    "ca.org1.example.com"
                ]
            },
            "Org2": {
                "mspid": "Org2MSP",
                "peers": [
                    "peer0.org2.example.com",
                    "peer1.org2.example.com"
                ],
                "certificateAuthorities": [
                    "ca.org2.example.com"
                ]
            }
        },
        "orderers": {
            "orderer.example.com": {
                "url": "grpcs://localhost:7050",
                "grpcOptions": {
                    "ssl-target-name-override": "orderer.example.com"
                },
                "tlsCACerts": {
                    "pem": "-----BEGIN CERTIFICATE-----\nMIICNjCCAdygAwIBAgIRAJJu67ezVNCJ4gM4zInHf/wwCgYIKoZIzj0EAwIwbDEL\nMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\ncmFuY2lzY28xFDASBgNVBAoTC2V4YW1wbGUuY29tMRowGAYDVQQDExF0bHNjYS5l\neGFtcGxlLmNvbTAeFw0xODA1MTgwNTUwMThaFw0yODA1MTUwNTUwMThaMGwxCzAJ\nBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJh\nbmNpc2NvMRQwEgYDVQQKEwtleGFtcGxlLmNvbTEaMBgGA1UEAxMRdGxzY2EuZXhh\nbXBsZS5jb20wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS1UB9Mbi0TXhCatds9\nn0jIB27R+2zOLlNpxCqNeZdRiMrIYyrX6EV5leFxwf4/MbHhAtK3Ji/rOQP9m57N\nb9IMo18wXTAOBgNVHQ8BAf8EBAMCAaYwDwYDVR0lBAgwBgYEVR0lADAPBgNVHRMB\nAf8EBTADAQH/MCkGA1UdDgQiBCDvbLbBi42xUsDE6QBAcgT1apjg23G3esLYg2h3\nJv3aUTAKBggqhkjOPQQDAgNIADBFAiEA4Gt4Z5i2vgoWgYX0gfOVnk2xhXzoHSga\nvlX0dbuurPgCIEhBWR/Bm2JMA9Hux9DVX3dqU56UM0dXaxzl2m6jMW7n\n-----END CERTIFICATE-----\n"
                }
            }
        },
        "peers": {
            "peer0.org1.example.com": {
                "url": "grpcs://localhost:7051",
                "eventUrl": "grpcs://localhost:7053",
                "grpcOptions": {
                    "ssl-target-name-override": "peer0.org1.example.com"
                },
                "tlsCACerts": {
                    "pem": "-----BEGIN CERTIFICATE-----\nMIICSTCCAfCgAwIBAgIRALIlDShhaFDpMZPEO77RDiwwCgYIKoZIzj0EAwIwdjEL\nMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\ncmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs\nc2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTgwNTE4MDU1MDE4WhcNMjgwNTE1MDU1\nMDE4WjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE\nBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G\nA1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49\nAwEHA0IABClWp8EhhP+vNjaGjTTd3WFTXvwQ8TzHdZaQz9+G77YBPknILmG6ojO2\nC9vI7QQGHJjEJKzaqyCXBVTwnHYnK6yjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV\nHSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEINj7sKXMJ1H+\nanNgqm13/1cZeQPqVmp2lM/YGslKcSxOMAoGCCqGSM49BAMCA0cAMEQCIG/W7ht1\nBnccqNWPRvMSzym2ALP56frZuCt1VXnLlGU8AiBOEd0sJ0KlGOeOgYKo3SckNASq\nI6IEmvqwSphYNtEjpw==\n-----END CERTIFICATE-----\n"
                }
            },
            "peer1.org1.example.com": {
                "url": "grpcs://localhost:8051",
                "eventUrl": "grpcs://localhost:8053",
                "grpcOptions": {
                    "ssl-target-name-override": "peer1.org1.example.com"
                },
                "tlsCACerts": {
                    "pem": "-----BEGIN CERTIFICATE-----\nMIICSTCCAfCgAwIBAgIRALIlDShhaFDpMZPEO77RDiwwCgYIKoZIzj0EAwIwdjEL\nMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBG\ncmFuY2lzY28xGTAXBgNVBAoTEG9yZzEuZXhhbXBsZS5jb20xHzAdBgNVBAMTFnRs\nc2NhLm9yZzEuZXhhbXBsZS5jb20wHhcNMTgwNTE4MDU1MDE4WhcNMjgwNTE1MDU1\nMDE4WjB2MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UE\nBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQb3JnMS5leGFtcGxlLmNvbTEfMB0G\nA1UEAxMWdGxzY2Eub3JnMS5leGFtcGxlLmNvbTBZMBMGByqGSM49AgEGCCqGSM49\nAwEHA0IABClWp8EhhP+vNjaGjTTd3WFTXvwQ8TzHdZaQz9+G77YBPknILmG6ojO2\nC9vI7QQGHJjEJKzaqyCXBVTwnHYnK6yjXzBdMA4GA1UdDwEB/wQEAwIBpjAPBgNV\nHSUECDAGBgRVHSUAMA8GA1UdEwEB/wQFMAMBAf8wKQYDVR0OBCIEINj7sKXMJ1H+\nanNgqm13/1cZeQPqVmp2lM/YGslKcSxOMAoGCCqGSM49BAMCA0cAMEQCIG/W7ht1\nBnccqNWPRvMSzym2ALP56frZuCt1VXnLlGU8AiBOEd0sJ0KlGOeOgYKo3SckNASq\nI6IEmvqwSphYNtEjpw==\n-----END CERTIFICATE-----\n"
                }
            },
            "peer0.org2.example.com": {
                "url": "grpcs://localhost:9051",
                "eventUrl": "grpcs://localhost:9053",
                "grpcOptions": {
                    "ssl-target-name-override": "peer0.org2.example.com"
                },
                "tlsCACerts": {
                    "pem": "-----BEGIN CERTIFICATE-----\nMIICSTCCAe+gAwIBAgIQIPrCKDtyMOXV7yYWEF/FETAKBggqhkjOPQQDAjB2MQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEfMB0GA1UEAxMWdGxz\nY2Eub3JnMi5leGFtcGxlLmNvbTAeFw0xODA1MTgwNTUwMThaFw0yODA1MTUwNTUw\nMThaMHYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH\nEw1TYW4gRnJhbmNpc2NvMRkwFwYDVQQKExBvcmcyLmV4YW1wbGUuY29tMR8wHQYD\nVQQDExZ0bHNjYS5vcmcyLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0D\nAQcDQgAEOiTR1rnVMPeONz/1R6ZE+oomhRv7XS8EDqQGGOGOHGw4yaPQIZDwNi0+\nTGwUW2A50KfIq+7N0yw81GjM9eCL5aNfMF0wDgYDVR0PAQH/BAQDAgGmMA8GA1Ud\nJQQIMAYGBFUdJQAwDwYDVR0TAQH/BAUwAwEB/zApBgNVHQ4EIgQgL1Mh2vjSEzwk\nXUngtDYFlZXtRhiijOjXqHLQXsQfu0cwCgYIKoZIzj0EAwIDSAAwRQIhAPWEqaqZ\nmFXmqmoa9w7iYtC9T5ZkYU6dlq/8PDHEcIuZAiBn25xxePB8eqoRQqvzmimd+HYq\nfdnGXkP2ijWzn3YUYg==\n-----END CERTIFICATE-----\n"
                }
            },
            "peer1.org2.example.com": {
                "url": "grpcs://localhost:10051",
                "eventUrl": "grpcs://localhost:10053",
                "grpcOptions": {
                    "ssl-target-name-override": "peer1.org2.example.com"
                },
                "tlsCACerts": {
                    "pem": "-----BEGIN CERTIFICATE-----\nMIICSTCCAe+gAwIBAgIQIPrCKDtyMOXV7yYWEF/FETAKBggqhkjOPQQDAjB2MQsw\nCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZy\nYW5jaXNjbzEZMBcGA1UEChMQb3JnMi5leGFtcGxlLmNvbTEfMB0GA1UEAxMWdGxz\nY2Eub3JnMi5leGFtcGxlLmNvbTAeFw0xODA1MTgwNTUwMThaFw0yODA1MTUwNTUw\nMThaMHYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQH\nEw1TYW4gRnJhbmNpc2NvMRkwFwYDVQQKExBvcmcyLmV4YW1wbGUuY29tMR8wHQYD\nVQQDExZ0bHNjYS5vcmcyLmV4YW1wbGUuY29tMFkwEwYHKoZIzj0CAQYIKoZIzj0D\nAQcDQgAEOiTR1rnVMPeONz/1R6ZE+oomhRv7XS8EDqQGGOGOHGw4yaPQIZDwNi0+\nTGwUW2A50KfIq+7N0yw81GjM9eCL5aNfMF0wDgYDVR0PAQH/BAQDAgGmMA8GA1Ud\nJQQIMAYGBFUdJQAwDwYDVR0TAQH/BAUwAwEB/zApBgNVHQ4EIgQgL1Mh2vjSEzwk\nXUngtDYFlZXtRhiijOjXqHLQXsQfu0cwCgYIKoZIzj0EAwIDSAAwRQIhAPWEqaqZ\nmFXmqmoa9w7iYtC9T5ZkYU6dlq/8PDHEcIuZAiBn25xxePB8eqoRQqvzmimd+HYq\nfdnGXkP2ijWzn3YUYg==\n-----END CERTIFICATE-----\n"
                }
            }
        },
        "certificateAuthorities": {
            "ca.org1.example.com": {
                "url": "https://localhost:7054",
                "caName": "ca-org1",
                "httpOptions": {
                    "verify": true
                }
            },
            "ca.org2.example.com": {
                "url": "https://localhost:8054",
                "caName": "ca-org2",
                "httpOptions": {
                    "verify": true
                }
            }
        }
    }

2 个答案:

答案 0 :(得分:0)

如果您按照教程"按原样#34;而不是将其用作自定义结构的基础,这可能是粘贴到connection.json文件中的证书的问题。需要将正确的证书粘贴到正确位置的文件中,但它们也需要在一个没有换行符的长字符串中。 (\ n \ n字符表示换行符,但不应该有实际的换行符。)证书应以-----BEGIN CERTIFICATE-----\n开头,并在末尾添加匹配的结束证书。

如果问题仍然存在,您应该发布您的connection.json文件,以及org1的CA容器日志中的任何错误。

答案 1 :(得分:0)

错误:未能请求身份。尝试注册用户并返回证书时出错。错误:调用注册端点失败,错误[错误:证书目的不受支持]。

从链接获得上述错误的解决方案 (https://github.com/hyperledger/composer/issues/3808)并且错误已经解决。

当它落后于HTTPS时,组合器CLI无法正确连接到Fabric CA。

这可以通过关闭connection.json文件中的验证来缓解。

"certificateAuthorities": {
           "myca.example.com": {
               "url": "https://myca.example.com:443",
               "caName": "myca.example.com",
               "httpOptions": {
                   "verify": false
               }
           }