Source file src/crypto/x509/root.go
Documentation: crypto/x509
1 // Copyright 2012 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package x509 6 7 //go:generate go run root_darwin_ios_gen.go -version 55161.80.1 8 9 import "sync" 10 11 var ( 12 once sync.Once 13 systemRoots *CertPool 14 systemRootsErr error 15 ) 16 17 func systemRootsPool() *CertPool { 18 once.Do(initSystemRoots) 19 return systemRoots 20 } 21 22 func initSystemRoots() { 23 systemRoots, systemRootsErr = loadSystemRoots() 24 if systemRootsErr != nil { 25 systemRoots = nil 26 } 27 } 28