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

Function init

credentials/tls_ext_test.go:60–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58var serverName = "x.test.example.com"
59
60func init() {
61 var err error
62 serverCert, err = tls.LoadX509KeyPair(testdata.Path("x509/server1_cert.pem"), testdata.Path("x509/server1_key.pem"))
63 if err != nil {
64 panic(fmt.Sprintf("tls.LoadX509KeyPair(server1.pem, server1.key) failed: %v", err))
65 }
66
67 b, err := os.ReadFile(testdata.Path("x509/server_ca_cert.pem"))
68 if err != nil {
69 panic(fmt.Sprintf("Error reading CA cert file: %v", err))
70 }
71 certPool = x509.NewCertPool()
72 if !certPool.AppendCertsFromPEM(b) {
73 panic("Error appending cert from PEM")
74 }
75}
76
77// Tests that the MinVersion of tls.Config is set to 1.2 if it is not already
78// set by the user.

Callers

nothing calls this directly

Calls 1

PathFunction · 0.92

Tested by

no test coverage detected