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

Function makeRootProvider

credentials/xds/xds_client_test.go:211–219  ·  view source on GitHub ↗

makeRootProvider creates a new instance of the fakeProvider returning the root key material specified in the provider file paths.

(t *testing.T, caPath string)

Source from the content-addressed store, hash-verified

209// makeRootProvider creates a new instance of the fakeProvider returning the
210// root key material specified in the provider file paths.
211func makeRootProvider(t *testing.T, caPath string) *fakeProvider {
212 pemData, err := os.ReadFile(testdata.Path(caPath))
213 if err != nil {
214 t.Fatal(err)
215 }
216 roots := x509.NewCertPool()
217 roots.AppendCertsFromPEM(pemData)
218 return &fakeProvider{km: &certprovider.KeyMaterial{Roots: roots}}
219}
220
221// newTestContextWithHandshakeInfo returns a copy of parent with HandshakeInfo
222// context value added to it.

Calls 2

PathFunction · 0.92
FatalMethod · 0.65

Tested by

no test coverage detected