initial commit
This commit is contained in:
commit
7715fcf373
37 changed files with 2957 additions and 0 deletions
19
pkg/config/ca.go
Normal file
19
pkg/config/ca.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func LoadCertPool(file string) (p *x509.CertPool, err error) {
|
||||
if file == "" {
|
||||
return
|
||||
}
|
||||
buf, err := ioutil.ReadFile(file)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
p = x509.NewCertPool()
|
||||
p.AppendCertsFromPEM(buf)
|
||||
return
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue