initial commit

This commit is contained in:
ston1th 2020-11-22 12:59:12 +01:00
commit 7715fcf373
37 changed files with 2957 additions and 0 deletions

19
pkg/config/ca.go Normal file
View 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
}