{"record":{"id":"897bfb650de88de9","repo":"hyperledger/fabric","slug":"core-comm-client-handshakes-are-not-implemented-w","errorCode":null,"errorMessage":"core/comm: client handshakes are not implemented with serverCreds","messagePattern":"core/comm: client handshakes are not implemented with serverCreds","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pkg/comm/creds.go","lineNumber":23,"sourceCode":"*/\n\npackage comm\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"errors\"\n\t\"net\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/hyperledger/fabric-lib-go/common/flogging\"\n\t\"google.golang.org/grpc/credentials\"\n)\n\nvar (\n\tErrClientHandshakeNotImplemented = errors.New(\"core/comm: client handshakes are not implemented with serverCreds\")\n\tErrServerHandshakeNotImplemented = errors.New(\"core/comm: server handshakes are not implemented with clientCreds\")\n\tErrOverrideHostnameNotSupported  = errors.New(\"core/comm: OverrideServerName is not supported\")\n\n\t// alpnProtoStr are the specified application level protocols for gRPC.\n\talpnProtoStr = []string{\"h2\"}\n\n\t// Logger for TLS client connections\n\ttlsClientLogger = flogging.MustGetLogger(\"comm.tls\")\n)\n\n// NewServerTransportCredentials returns a new initialized\n// grpc/credentials.TransportCredentials\nfunc NewServerTransportCredentials(\n\tserverConfig *TLSConfig,\n\tlogger *flogging.FabricLogger,\n) credentials.TransportCredentials {\n\t// NOTE: unlike the default grpc/credentials implementation, we do not\n\t// clone the tls.Config which allows us to update it dynamically","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/pkg/comm/creds.go#L5-L41","documentation":"Sentinel error returned by serverCreds.ClientHandshake: these transport credentials only implement the server side of gRPC TLS, so calling the client-side handshake on them is a programming misuse. Exported as ErrClientHandshakeNotImplemented and asserted in creds_test.go.","triggerScenarios":"Thrown at internal/pkg/comm/creds.go:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use NewServerTransportCredentials results only as server options","Use DynamicClientCredentials/client credentials for client connections"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}