MCPcopy Create free account
hub / github.com/prometheus/common / readCAFile

Function readCAFile

config/http_config.go:1004–1010  ·  view source on GitHub ↗

readCAFile reads the CA cert file from disk.

(f string)

Source from the content-addressed store, hash-verified

1002
1003// readCAFile reads the CA cert file from disk.
1004func readCAFile(f string) ([]byte, error) {
1005 data, err := os.ReadFile(f)
1006 if err != nil {
1007 return nil, fmt.Errorf("unable to load specified CA cert %s: %w", f, err)
1008 }
1009 return data, nil
1010}
1011
1012// updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs.
1013func updateRootCA(cfg *tls.Config, b []byte) bool {

Callers 1

NewTLSConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected