9func GetCertPool(paths []string) (*x509.CertPool, error) {
11 return nil, fmt.Errorf("invalid empty list of Root CAs file paths")
13 pool := x509.NewCertPool()
14 for _, path := range paths {
15 // Cert paths are a configurable option
16 data, err := ioutil.ReadFile(path) // #nosec G304
18 return nil, fmt.Errorf("certificate authority file (%s) could not be read - %s", path, err)
20 if !pool.AppendCertsFromPEM(data) {
21 return nil, fmt.Errorf("loading certificate authority (%s) failed", path)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list