MCPcopy
hub / github.com/fabiolb/fabio / makeCertPool

Function makeCertPool

cert/source_test.go:680–689  ·  view source on GitHub ↗
(x ...[]byte)

Source from the content-addressed store, hash-verified

678}
679
680func makeCertPool(x ...[]byte) *x509.CertPool {
681 p := x509.NewCertPool()
682 for _, b := range x {
683 // https://github.com/fabiolb/fabio/issues/434
684 if ok := p.AppendCertsFromPEM(b); !ok {
685 panic("failed to add cert from PEM. Is the CN a DNS compatible name?")
686 }
687 }
688 return p
689}
690
691func saveCert(dir, host string, certPEM, keyPEM []byte) (certFile, keyFile string) {
692 certFile, keyFile = filepath.Join(dir, host+"-cert.pem"), filepath.Join(dir, host+"-key.pem")

Callers 8

TestTLSConfigFunction · 0.85
TestStaticSourceFunction · 0.85
TestFileSourceFunction · 0.85
TestPathSourceFunction · 0.85
TestHTTPSourceFunction · 0.85
TestConsulSourceFunction · 0.85
TestVaultSourceFunction · 0.85
TestVaultPKISourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected