Versions in this module Expand all Collapse all v0 v0.0.0 Mar 18, 2022 Changes in this version + const DefaultMaxRecvMsgSize + const DefaultMaxSendMsgSize + var DefaultConnectionTimeout = 5 * time.Second + var DefaultKeepaliveOptions = KeepaliveOptions + var DefaultTLSCipherSuites = []uint16 + var ErrClientHandshakeNotImplemented = errors.New("core/comm: client handshakes are not implemented with serverCreds") + var ErrOverrideHostnameNotSupported = errors.New("core/comm: OverrideServerName is not supported") + var ErrServerHandshakeNotImplemented = 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 GetLocalIP() (string, error) + func NewServerTransportCredentials(serverConfig *TLSConfig, 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 ClientConfig struct + AsyncConnect bool + KaOpts KeepaliveOptions + MaxRecvMsgSize int + MaxSendMsgSize int + SecOpts SecureOptions + Timeout time.Duration + func (cc ClientConfig) Clone() ClientConfig + type CredentialSupport struct + func NewCredentialSupport(rootCAs ...[]byte) *CredentialSupport + func (cs *CredentialSupport) AppRootCAsByChain() map[string][][]byte + func (cs *CredentialSupport) BuildTrustedRootsForChain(cm channelconfig.Resources) + func (cs *CredentialSupport) GetClientCertificate() tls.Certificate + 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 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, tlsOptions ...TLSOption) (*grpc.ClientConn, error) + 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) Listener() net.Listener + func (gServer *GRPCServer) MutualTLSRequired() bool + 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 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 ServerConfig struct + ConnectionTimeout time.Duration + HealthCheckEnabled bool + KaOpts KeepaliveOptions + Logger *flogging.FabricLogger + MaxRecvMsgSize int + MaxSendMsgSize int + 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 TLSConfig struct + func NewTLSConfig(config *tls.Config) *TLSConfig + func (t *TLSConfig) AddClientRootCA(cert *x509.Certificate) + func (t *TLSConfig) Config() tls.Config + func (t *TLSConfig) SetClientCAs(certPool *x509.CertPool) + type TLSOption func(tlsConfig *tls.Config) + func CertPoolOverride(pool *x509.CertPool) TLSOption + func ServerNameOverride(name string) TLSOption Incompatible versions in this module v2.1.1+incompatible Jun 1, 2020 v2.1.0+incompatible Apr 15, 2020