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

Function NewServerTLSFromFile

credentials/tls.go:302–308  ·  view source on GitHub ↗

NewServerTLSFromFile constructs TLS credentials from the input certificate file and key file for server.

(certFile, keyFile string)

Source from the content-addressed store, hash-verified

300// NewServerTLSFromFile constructs TLS credentials from the input certificate file and key
301// file for server.
302func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error) {
303 cert, err := tls.LoadX509KeyPair(certFile, keyFile)
304 if err != nil {
305 return nil, err
306 }
307 return NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}), nil
308}
309
310// TLSChannelzSecurityValue defines the struct that TLS protocol should return
311// from GetSecurityValue(), containing security info like cipher and certificate used.

Callers 15

makeFallbackServerCredsFunction · 0.92
startBenchmarkServerFunction · 0.92
mainFunction · 0.92
mainFunction · 0.92
TestCredsBundleBothMethod · 0.92
listenAndServeMethod · 0.92
mainFunction · 0.92
mainFunction · 0.92

Calls 1

NewTLSFunction · 0.85