我们有一个非常简单的设置,其中我们通过运行来启动fabric-ca-server实例

/bin/bash -c "fabric-ca-server start -b admin:adminpw"


在docker容器中,如here所述。但是当我们尝试通过运行来注册用户时

root@a7094a09a3b7:/etc/hyperledger/fabric-ca-client# fabric-ca-client enroll -u http://user:userpw@localhost:7054


我们得到以下错误:

2018/12/07 21:06:17 [INFO] generating key: &{A:ecdsa S:256}
2018/12/07 21:06:17 [INFO] encoded CSR
Error: POST failure of request: POST http://localhost:7054/enroll
{"hosts":["a7094a09a3b7"],"certificate_request":"-----BEGIN CERTIFICATE REQUEST-----\nMIIBQzCB6wIBADBfMQswCQYDVQQGEwJVUzEXMBUGA1UECBMOTm9ydGggQ2Fyb2xp\nbmExFDASBgNVBAoTC0h5cGVybGVkZ2VyMQ8wDQYDVQQLEwZGYWJyaWMxEDAOBgNV\nBAMTB3NqYWluNjgwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASiWBUZ5vG5i9X9\nAV8fdfuxFAFsWHeg4JRpNFs/m7knB3QaDWDbbk/G53gEbgyv2scg61cYMNdLDaYK\nGi9ywX0noCowKAYJKoZIhvcNAQkOMRswGTAXBgNVHREEEDAOggxhNzA5NGEwOWEz\nYjcwCgYIKoZIzj0EAwIDRwAwRAIgTY0gn18UIsKfOLgS33F41ORAlKNz2tZS6ip5\nXS03XNICIAE3C9nhv2d4ZrCcO+7rycWLoR6wEU6cnAqZsSf1Txz4\n-----END CERTIFICATE REQUEST-----\n","profile":"","crl_override":"","label":"","NotBefore":"0001-01-01T00:00:00Z","NotAfter":"0001-01-01T00:00:00Z","CAName":""}: Post http://localhost:7054/enroll: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02\x16"


并且fabric-ca-server输出显示:

http: TLS handshake error from 127.0.0.1:53356: tls: oversized record received with length 21536


想知道我们在做什么错,我们该如何解决?

最佳答案

看起来您是在启用TLS的情况下启动了fabric-ca-server的,而您没有在fabric-ca-client上使用TLS。您需要在URL中指定https
fabric-ca-client enroll -u https://user:userpw@localhost:7054

或者,在结构CA配置中禁用TLS。

关于hyperledger-fabric - Hyperledger Fabric CA:http:来自127.0.0.1:53356的TLS握手错误:tls:接收到长度为21536的超大记录,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53676893/

10-16 23:45