Documentation ¶
Index ¶
- func ClientTLS(caCert, cert, key []byte, peerName string) (*tls.Config, error)
- func Connect(endpoint string, tlsConfig *tls.Config, dialOptions ...grpc.DialOption) (*grpc.ClientConn, error)
- func LoadClientTLS(caFile, certFile, keyFile, peerName string) (*tls.Config, error)
- func LoadServerTLS(ctx context.Context, caFile, certFile, keyFile, peerName string) (*tls.Config, error)
- func NewServer(endpoint, errorPrefix string, tlsConfig *tls.Config, ...) (*grpc.Server, net.Listener, error)
- func ServerTLS(ctx context.Context, caCert, cert, key []byte, peerName string) (*tls.Config, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientTLS ¶ added in v0.7.0
ClientTLS prepares the TLS configuration that can be used by a client while connecting to a server with given encoded certificate and private key. peerName must be provided when expecting the server to offer a certificate with that CommonName.
func Connect ¶
func Connect(endpoint string, tlsConfig *tls.Config, dialOptions ...grpc.DialOption) (*grpc.ClientConn, error)
Connect is a helper function to initiate a grpc client connection to server running at endpoint using tlsConfig
func LoadClientTLS ¶
LoadClientTLS prepares the TLS configuration that can be used by a client while connecting to a server. peerName must be provided when expecting the server to offer a certificate with that CommonName. caFile, certFile, and keyFile are all optional.
func LoadServerTLS ¶
func LoadServerTLS(ctx context.Context, caFile, certFile, keyFile, peerName string) (*tls.Config, error)
LoadServerTLS prepares the TLS configuration needed for a server with the given certificate files. peerName is either the name that the client is expected to have a certificate for or empty, in which case any client is allowed to connect.
func NewServer ¶
func NewServer(endpoint, errorPrefix string, tlsConfig *tls.Config, csiMetricsManager metrics.CSIMetricsManager, opts ...grpc.ServerOption) (*grpc.Server, net.Listener, error)
NewServer is a helper function to start a grpc server at the given endpoint. The error prefix is added to all error messages if not empty.
Types ¶
This section is empty.