mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-22 02:06:18 +08:00
22 lines
346 B
Go
22 lines
346 B
Go
package smx509
|
|
|
|
import "sync"
|
|
|
|
var (
|
|
once sync.Once
|
|
systemRoots *CertPool
|
|
systemRootsErr error
|
|
)
|
|
|
|
func systemRootsPool() *CertPool {
|
|
once.Do(initSystemRoots)
|
|
return systemRoots
|
|
}
|
|
|
|
func initSystemRoots() {
|
|
systemRoots, systemRootsErr = loadSystemRoots()
|
|
if systemRootsErr != nil {
|
|
systemRoots = nil
|
|
}
|
|
}
|