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

Function makeIdentityProvider

examples/features/advancedtls/client/main.go:65–83  ·  view source on GitHub ↗
(revoked bool, credsDirectory string)

Source from the content-addressed store, hash-verified

63}
64
65func makeIdentityProvider(revoked bool, credsDirectory string) certprovider.Provider {
66 var certFile string
67 if revoked {
68 certFile = filepath.Join(credsDirectory, "client_cert_revoked.pem")
69 } else {
70 certFile = filepath.Join(credsDirectory, "client_cert.pem")
71 }
72 identityOptions := pemfile.Options{
73 CertFile: certFile,
74 KeyFile: filepath.Join(credsDirectory, "client_key.pem"),
75 RefreshDuration: credRefreshInterval,
76 }
77 identityProvider, err := pemfile.NewProvider(identityOptions)
78 if err != nil {
79 fmt.Printf("Error %v\n", err)
80 os.Exit(1)
81 }
82 return identityProvider
83}
84
85func runClientWithProviders(rootProvider certprovider.Provider, identityProvider certprovider.Provider, crlProvider advancedtls.CRLProvider, port string, shouldFail bool) {
86 options := &advancedtls.Options{

Callers 3

tlsWithCRLsToGoodServerFunction · 0.70

Calls 3

NewProviderFunction · 0.92
JoinMethod · 0.80
PrintfMethod · 0.65

Tested by

no test coverage detected