updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs.
(cfg *tls.Config, b []byte)
| 1464 | |
| 1465 | // updateRootCA parses the given byte slice as a series of PEM encoded certificates and updates tls.Config.RootCAs. |
| 1466 | func 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…