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

Function updateRootCA

config/http_config.go:1466–1473  ·  view source on GitHub ↗

updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs.

(cfg *tls.Config, b []byte)

Source from the content-addressed store, hash-verified

1464
1465// updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs.
1466func updateRootCA(cfg *tls.Config, b []byte) bool {
1467 caCertPool := x509.NewCertPool()
1468 if !caCertPool.AppendCertsFromPEM(b) {
1469 return false
1470 }
1471 cfg.RootCAs = caCertPool
1472 return true
1473}
1474
1475// tlsRoundTripper is a RoundTripper that updates automatically its TLS
1476// configuration whenever the content of the CA file changes.

Callers 2

NewTLSConfigWithContextFunction · 0.85
RoundTripMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…