hyperledger/fabric · error

core/comm: client handshakes are not implemented with server

Error message

core/comm: client handshakes are not implemented with serverCreds

What it means

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.

Source

Thrown at internal/pkg/comm/creds.go:23

*/

package comm

import (
	"context"
	"crypto/tls"
	"crypto/x509"
	"errors"
	"net"
	"sync"
	"time"

	"github.com/hyperledger/fabric-lib-go/common/flogging"
	"google.golang.org/grpc/credentials"
)

var (
	ErrClientHandshakeNotImplemented = errors.New("core/comm: client handshakes are not implemented with serverCreds")
	ErrServerHandshakeNotImplemented = errors.New("core/comm: server handshakes are not implemented with clientCreds")
	ErrOverrideHostnameNotSupported  = errors.New("core/comm: OverrideServerName is not supported")

	// alpnProtoStr are the specified application level protocols for gRPC.
	alpnProtoStr = []string{"h2"}

	// Logger for TLS client connections
	tlsClientLogger = flogging.MustGetLogger("comm.tls")
)

// NewServerTransportCredentials returns a new initialized
// grpc/credentials.TransportCredentials
func NewServerTransportCredentials(
	serverConfig *TLSConfig,
	logger *flogging.FabricLogger,
) credentials.TransportCredentials {
	// NOTE: unlike the default grpc/credentials implementation, we do not
	// clone the tls.Config which allows us to update it dynamically

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Use NewServerTransportCredentials results only as server options
  2. Use DynamicClientCredentials/client credentials for client connections
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at internal/pkg/comm/creds.go:23 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/897bfb650de88de9. Report an issue: GitHub.