If you want to turn on TLS, you just need to set the TLS attribute of orderer, peer, CLI and Ca to true, and configure the file address such as certificate and key. These are the following attributes:
CORE_ PEER_ TLS_ ENABLED=trueCORE_ PEER_ TLS_ CERT_ FILE=xxx/tls/ server.crtCORE_ PEER_ TLS_ KEY_ FILE=xxx/tls/ server.keyCORE_ PEER_ TLS_ ROOTCERT_ FILE=xxx/tls/ ca.crt
After that, start the container to enter the CLI. It should be noted that after the TLS mode is turned on, the command to create a channel is different from that when the TLS mode is not turned on. When the TLS mode is not turned on, the command to create a channel is as follows:
peer channel create -o orderer.scf.com:7050 -c mychannel -t 50 -f ./channel-artifacts/ mychannel.tx
After opening TLS, the TLS parameter and the certificate file address of the sorting service should be added when creating the channel
peer channel create -o orderer.scf.com:7050 -c mychannel -t 50 –tls –cafile /opt/gopath/src/ github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/scf .com/orderers/ orderer.scf.com/msp/tlscacerts/tlsca . scf.com – cert.pem -f ./channel-artifacts/ mychannel.tx
If you still use the command when TLS is not turned on to create a channel, the following error will be reported in the CLI:
2019-04-11 17:31:48.661 UTC [grpc] Printf -> DEBU 010 transport: http2 Client.notifyError got notified that the client transport was broken unexpected EOF.
2019-04-11 17:31:48.667 UTC [grpc] Printf -> DEBU 011 transport: http2 Client.notifyError got notified that the client transport was broken unexpected EOF.
2019-04-11 17:31:48.668 UTC [grpc] Printf -> DEBU 012 transport: http2 Client.notifyError got notified that the client transport was broken read tcp 172.18.0.10:59602-> 172.18.0.2:7050: read: connection reset by peer
orderer.scf.com | 2019-04-11 17:31:48.654 UTC [grpc] Printf -> DEBU 3da grpc: Server.Serve failed to complete security handshake from “172.18.0.10:59598”: tls: first record does not look like a TLS handshake
Next, the commands for peer to add channel, install chain code and query are the same as when TLS is not turned on. However, when instantiating chain code and calling invoke, you need to add parameters such as TLS in the command as when creating channel, otherwise the above error will be reported.
In other words, if TLS mode is enabled, as long as communication with orderer is involved, two parameters – TLS and – cafile need to be added to the command line parameters. Cafile parameter corresponds to the corresponding file of orderer module.
Read More:
- Grpc client access server prompt: RPC error: code = unimplemented desc = unknown service possible reasons
- Error: Error endorsing chaincode: rpc error: code = 2 desc = Error installing chaincode code test_cc
- Error message error response from daemon: RPC error: code = unavailable when deploying swarm cluster. Solution:
- error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was
- 【Error】gRPC failure=Status{code=UNAVAILABLE, description=io exception, cause=io.netty.channel.
- WIN7 + IIS7 Service Unavailable HTTP Error 503. The service is unavailable.
- Ror deployed to heroku has application error and code = H10 desc = “app crashed” problems
- [Solved] nested exception is com.alibaba.dubbo.rpc.RpcException: Failed t o invoke the method findPage
- Samba getpeername failed. Error was transport endpoint is not connected error
- git clone prompt error: RPC failed result=22, HTTP code = 404 problem
- Resourcemanger reported an error: the port is unavailable
- [Tomcat] an error is reported when Tomcat starts ERROR:transport error 202:bind failed:Address already
- SQLServerException: The server failed to resume the transaction. Desc:ab00000002
- Elasticsearch startup process error: org.elasticsearch.transport .BindTransportException: Failed to bind to [9300-9400
- Centos7 viewing and closing firewalls
- On the problem that VTK + QT process can’t end after closing the program
- code is 143 Container exited with a non-zero exit code 143
- Transport (VMDB) error -44: Message.
- ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
- Unity Android solves the problem of information flow advertisement closing and error reporting