(x ...[]byte)
| 678 | } |
| 679 | |
| 680 | func 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 | |
| 691 | func 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") |
no outgoing calls
no test coverage detected