Versions in this module Expand all Collapse all v1 v1.4.6 Feb 25, 2020 Changes in this version + var ClientHandshakeNotImplError = errors.New(...) + var DefaultConnectionTimeout = 5 * time.Second + var DefaultKeepaliveOptions = &KeepaliveOptions + var DefaultTLSCipherSuites = []uint16 + var EndpointDisableInterval = time.Second * 10 + var MaxRecvMsgSize = 100 * 1024 * 1024 + var MaxSendMsgSize = 100 * 1024 * 1024 + var MissingServerConfigError = errors.New("core/comm: `serverConfig` cannot be nil") + var OverrrideHostnameNotSupportedError = errors.New(...) + var ServerHandshakeNotImplementedError = errors.New("core/comm: server handshakes are not implemented with clientCreds") + func AddPemToCertPool(pemCerts []byte, pool *x509.CertPool) error + func ClientKeepaliveOptions(ka *KeepaliveOptions) []grpc.DialOption + func ExtractCertificateFromContext(ctx context.Context) *x509.Certificate + func ExtractCertificateHashFromContext(ctx context.Context) []byte + func ExtractRawCertificateFromContext(ctx context.Context) []byte + func InitTLSForShim(key, certStr string) credentials.TransportCredentials + func NewClientConnectionWithAddress(peerAddress string, block bool, tslEnabled bool, ...) (*grpc.ClientConn, error) + func NewServerTransportCredentials(serverConfig *tls.Config, logger *flogging.FabricLogger) credentials.TransportCredentials + func ServerKeepaliveOptions(ka *KeepaliveOptions) []grpc.ServerOption + type BindingInspector func(context.Context, proto.Message) error + func NewBindingInspector(mutualTLS bool, extractTLSCertHash CertHashExtractor) BindingInspector + type CertHashExtractor func(proto.Message) []byte + type CertificateBundle [][]byte + type ClientConfig struct + AsyncConnect bool + KaOpts *KeepaliveOptions + SecOpts *SecureOptions + Timeout time.Duration + func (cc ClientConfig) Clone() ClientConfig + type ConnProducer struct + func NewConnectionProducer(factory ConnectionFactory, endpoints []EndpointCriteria) *ConnProducer + func (cp *ConnProducer) GetEndpoints() []EndpointCriteria + func (cp *ConnProducer) NewConnection() (*grpc.ClientConn, string, error) + func (cp *ConnProducer) UpdateEndpoints(endpoints []EndpointCriteria) + type ConnectionFactory func(criteria EndpointCriteria) (*grpc.ClientConn, error) + type ConnectionProducer interface + GetEndpoints func() []EndpointCriteria + NewConnection func() (*grpc.ClientConn, string, error) + UpdateEndpoints func(endpoints []EndpointCriteria) + type CredentialSupport struct + AppRootCAsByChain map[string]CertificateBundle + ClientRootCAs CertificateBundle + OrdererRootCAsByChainAndOrg OrgRootCAs + ServerRootCAs CertificateBundle + func GetCredentialSupport() *CredentialSupport + func (cs *CredentialSupport) GetClientCertificate() tls.Certificate + func (cs *CredentialSupport) GetDeliverServiceCredentials(channelID string, appendStaticRoots bool, orgs []string, ...) (credentials.TransportCredentials, error) + func (cs *CredentialSupport) GetPeerCredentials() credentials.TransportCredentials + func (cs *CredentialSupport) SetClientCertificate(cert tls.Certificate) + type DynamicClientCredentials struct + TLSConfig *tls.Config + TLSOptions []TLSOption + func (dtc *DynamicClientCredentials) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) + func (dtc *DynamicClientCredentials) Clone() credentials.TransportCredentials + func (dtc *DynamicClientCredentials) Info() credentials.ProtocolInfo + func (dtc *DynamicClientCredentials) OverrideServerName(name string) error + func (dtc *DynamicClientCredentials) ServerHandshake(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) + type EndpointCriteria struct + Endpoint string + Organizations []string + func (ec EndpointCriteria) Equals(other EndpointCriteria) bool + type GRPCClient struct + func NewGRPCClient(config ClientConfig) (*GRPCClient, error) + func (client *GRPCClient) Certificate() tls.Certificate + func (client *GRPCClient) MutualTLSRequired() bool + func (client *GRPCClient) NewConnection(address string, serverNameOverride string, tlsOptions ...TLSOption) (*grpc.ClientConn, error) + func (client *GRPCClient) SetMaxRecvMsgSize(size int) + func (client *GRPCClient) SetMaxSendMsgSize(size int) + func (client *GRPCClient) SetServerRootCAs(serverRoots [][]byte) error + func (client *GRPCClient) TLSEnabled() bool + type GRPCServer struct + func NewGRPCServer(address string, serverConfig ServerConfig) (*GRPCServer, error) + func NewGRPCServerFromListener(listener net.Listener, serverConfig ServerConfig) (*GRPCServer, error) + func (gServer *GRPCServer) Address() string + func (gServer *GRPCServer) AppendClientRootCAs(clientRoots [][]byte) error + func (gServer *GRPCServer) Listener() net.Listener + func (gServer *GRPCServer) MutualTLSRequired() bool + func (gServer *GRPCServer) RemoveClientRootCAs(clientRoots [][]byte) error + func (gServer *GRPCServer) Server() *grpc.Server + func (gServer *GRPCServer) ServerCertificate() tls.Certificate + func (gServer *GRPCServer) SetClientRootCAs(clientRoots [][]byte) error + func (gServer *GRPCServer) SetServerCertificate(cert tls.Certificate) + func (gServer *GRPCServer) Start() error + func (gServer *GRPCServer) Stop() + func (gServer *GRPCServer) TLSEnabled() bool + type KeepaliveOptions struct + ClientInterval time.Duration + ClientTimeout time.Duration + ServerInterval time.Duration + ServerMinInterval time.Duration + ServerTimeout time.Duration + type Metrics struct + ClosedConnCounter metrics.Counter + OpenConnCounter metrics.Counter + type NewSemaphoreFunc func(size int) Semaphore + type OrdererEndpoint struct + Address string + PEMs []byte + type OrgRootCAs map[string]PerOrgCertificateBundle + func (orc OrgRootCAs) AppendCertificates(channel string, org string, rootCAs CertificateBundle) + func (orc OrgRootCAs) CertificatesByChannelAndOrg(channel string, org string) CertificateBundle + type PerOrgCertificateBundle map[string]CertificateBundle + type SecureOptions struct + Certificate []byte + CipherSuites []uint16 + ClientRootCAs [][]byte + Key []byte + RequireClientCert bool + ServerRootCAs [][]byte + TimeShift time.Duration + UseTLS bool + VerifyCertificate func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error + type Semaphore interface + Acquire func(ctx context.Context) error + Release func() + type ServerConfig struct + ConnectionTimeout time.Duration + KaOpts *KeepaliveOptions + Logger *flogging.FabricLogger + SecOpts *SecureOptions + ServerStatsHandler *ServerStatsHandler + StreamInterceptors []grpc.StreamServerInterceptor + UnaryInterceptors []grpc.UnaryServerInterceptor + type ServerStatsHandler struct + ClosedConnCounter metrics.Counter + OpenConnCounter metrics.Counter + func NewServerStatsHandler(p metrics.Provider) *ServerStatsHandler + func (h *ServerStatsHandler) HandleConn(ctx context.Context, s stats.ConnStats) + func (h *ServerStatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats) + func (h *ServerStatsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context + func (h *ServerStatsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context + type TLSOption func(tlsConfig *tls.Config) + type Throttle struct + func NewThrottle(maxConcurrency int, options ...ThrottleOption) *Throttle + func (t *Throttle) StreamServerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error + func (t *Throttle) UnaryServerIntercptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error) + type ThrottleOption func(t *Throttle) + func WithNewSemaphore(newSemaphore NewSemaphoreFunc) ThrottleOption