MCPcopy
hub / github.com/grpc/grpc-go / NewClientTLSFromCert

Function NewClientTLSFromCert

credentials/tls.go:269–271  ·  view source on GitHub ↗

NewClientTLSFromCert constructs TLS credentials from the provided root certificate authority certificate(s) to validate server connections. If certificates to establish the identity of the client need to be included in the credentials (eg: for mTLS), use NewTLS instead, where a complete tls.Config c

(cp *x509.CertPool, serverNameOverride string)

Source from the content-addressed store, hash-verified

267// requests. Users should use grpc.WithAuthority passed to grpc.NewClient to
268// override the authority of the client instead.
269func NewClientTLSFromCert(cp *x509.CertPool, serverNameOverride string) TransportCredentials {
270 return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp})
271}
272
273// NewClientTLSFromFile constructs TLS credentials from the provided root
274// certificate authority certificate file(s) to validate server connections. If

Callers 3

mainFunction · 0.92
newConnFunction · 0.92
createTestConnFunction · 0.92

Calls 1

NewTLSFunction · 0.85

Tested by

no test coverage detected