19 lines
262 B
Go
19 lines
262 B
Go
package config
|
|
|
|
import (
|
|
"crypto/x509"
|
|
"os"
|
|
)
|
|
|
|
func LoadCertPool(file string) (p *x509.CertPool, err error) {
|
|
if file == "" {
|
|
return
|
|
}
|
|
buf, err := os.ReadFile(file)
|
|
if err != nil {
|
|
return
|
|
}
|
|
p = x509.NewCertPool()
|
|
p.AppendCertsFromPEM(buf)
|
|
return
|
|
}
|