Source file src/crypto/x509/root.go

     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  //go:generate go run root_ios_gen.go -version 55188.120.1.0.1
    12  
    13  import "sync"
    14  
    15  var (
    16  	once           sync.Once
    17  	systemRoots    *CertPool
    18  	systemRootsErr error
    19  )
    20  
    21  func systemRootsPool() *CertPool {
    22  	once.Do(initSystemRoots)
    23  	return systemRoots
    24  }
    25  
    26  func initSystemRoots() {
    27  	systemRoots, systemRootsErr = loadSystemRoots()
    28  	if systemRootsErr != nil {
    29  		systemRoots = nil
    30  	}
    31  }
    32  

View as plain text