Init
This commit is contained in:
20
pkg/castore/castore.go
Normal file
20
pkg/castore/castore.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user