MCPcopy
hub / github.com/helm/helm / WithCertKeyPairFiles

Function WithCertKeyPairFiles

internal/tlsutil/tls.go:44–65  ·  view source on GitHub ↗
(certFile, keyFile string)

Source from the content-addressed store, hash-verified

42}
43
44func WithCertKeyPairFiles(certFile, keyFile string) TLSConfigOption {
45 return func(options *TLSConfigOptions) error {
46 if certFile == "" && keyFile == "" {
47 return nil
48 }
49
50 certPEMBlock, err := os.ReadFile(certFile)
51 if err != nil {
52 return fmt.Errorf("unable to read cert file: %q: %w", certFile, err)
53 }
54
55 keyPEMBlock, err := os.ReadFile(keyFile)
56 if err != nil {
57 return fmt.Errorf("unable to read key file: %q: %w", keyFile, err)
58 }
59
60 options.certPEMBlock = certPEMBlock
61 options.keyPEMBlock = keyPEMBlock
62
63 return nil
64 }
65}
66
67func WithCAFile(caFile string) TLSConfigOption {
68 return func(options *TLSConfigOptions) error {

Callers 9

setupFunction · 0.92
newRegistryClientWithTLSFunction · 0.92
MakeTestTLSConfigFunction · 0.92
TestDownloadTLSFunction · 0.92
newRegistryClientMethod · 0.92
httpClientMethod · 0.92
newRegistryClientMethod · 0.92
TestNewTLSConfigFunction · 0.85

Calls

no outgoing calls

Tested by 4

setupFunction · 0.74
TestDownloadTLSFunction · 0.74
TestNewTLSConfigFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…