{"record":{"id":"23e5bf4667cb5e4f","repo":"hyperledger/fabric","slug":"core-comm-overrideservername-is-not-supported","errorCode":null,"errorMessage":"core/comm: OverrideServerName is not supported","messagePattern":"core/comm: OverrideServerName is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pkg/comm/creds.go","lineNumber":25,"sourceCode":"package 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\n\tserverConfig.config.NextProtos = alpnProtoStr\n\tserverConfig.config.MinVersion = tls.VersionTLS12","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/pkg/comm/creds.go#L7-L43","documentation":"Sentinel error returned by serverCreds.OverrideServerName: overriding the server name is not supported by these server-side credentials. Exported as ErrOverrideHostnameNotSupported and asserted in creds_test.go; its appearance signals an unsupported API call rather than a runtime fault.","triggerScenarios":"Thrown at internal/pkg/comm/creds.go:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure ServerNameOverride in SecureOptions when building the TLS config instead","Remove calls to OverrideServerName on server credentials"],"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"}