hyperledger / fabric-gateway

Go, Node and Java client API for Hyperledger Fabric v2.4+
https://hyperledger.github.io/fabric-gateway/
Apache License 2.0
145 stars 87 forks source link

The gateway example does not include an explanation of tls #692

Closed javaandfly closed 4 months ago

javaandfly commented 4 months ago

Problem Description

2024-03-13 09:58:34.424 UTC 00d5 ERRO [core.comm] ServerHandshake -> Server TLS handshake failed in 1.82695ms with error tls: first record does not look like a TLS handshake server=PeerServer remoteaddress=192.168.80.223: 65126

-The example does not explain how to configure tls. I found relevant tls configuration in the document. url:https://hyperledger-fabric.readthedocs.io/en/release-2.5/write_first_app.html#first-establish-a-grpc-connection-to-the-gateway

bestbeforetoday commented 4 months ago

Is it correct that you are referring to the following code examples in the API documentation?

If so, you are absolutely correct that they don't demonstrate TLS configuration for the gRPC connection. The intention was to keep the code snippets as small as practical and only demonstrate the Fabric Gateway API flow. I appreciate that Fabric networks are (almost) always created with TLS enabled so there is value in including the TLS configuration for the gRPC connection.

Note that all of the Fabric sample applications demonstrate TLS configuration of the gRPC connection. These are referred to on the Fabric Gateway documentation site homepage and on the quickstart guides for each client language: