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 // To update the embedded iOS root store, update the -version 8 // argument to the latest security_certificates version from 9 // https://opensource.apple.com/source/security_certificates/ 10 // and run "go generate". See https://golang.org/issue/38843. 11 // 12 //go:generate go run root_ios_gen.go -version 55188.120.1.0.1 13 14 import "sync" 15 16 var ( 17 once sync.Once 18 systemRoots *CertPool 19 systemRootsErr error 20 ) 21 22 func systemRootsPool() *CertPool { 23 once.Do(initSystemRoots) 24 return systemRoots 25 } 26 27 func initSystemRoots() { 28 systemRoots, systemRootsErr = loadSystemRoots() 29 if systemRootsErr != nil { 30 systemRoots = nil 31 } 32 } 33