This commit is contained in:
2022-10-16 12:47:15 +03:00
commit 15b60eed34
8 changed files with 172 additions and 0 deletions

20
pkg/castore/castore.go Normal file
View File

@@ -0,0 +1,20 @@
package castore
import (
"crypto/x509"
_ "embed"
"log"
"os"
)
//go:embed ca.crt
var CACert []byte
func NewCAstore() *x509.CertPool {
logger := log.New(os.Stderr, "", log.Lshortfile)
certPool := x509.NewCertPool()
if !certPool.AppendCertsFromPEM(CACert) {
logger.Fatal("Can't append CertPool with embedded CA")
}
return certPool
}