root_plan9.go 772 B

123456789101112131415161718192021222324252627282930313233
  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. // +build plan9
  5. package x509
  6. import "io/ioutil"
  7. // Possible certificate files; stop after finding one.
  8. var certFiles = []string{
  9. "/sys/lib/tls/ca.pem",
  10. }
  11. func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) {
  12. return nil, nil
  13. }
  14. func initSystemRoots() {
  15. roots := NewCertPool()
  16. for _, file := range certFiles {
  17. data, err := ioutil.ReadFile(file)
  18. if err == nil {
  19. roots.AppendCertsFromPEM(data)
  20. systemRoots = roots
  21. return
  22. }
  23. }
  24. // All of the files failed to load. systemRoots will be nil which will
  25. // trigger a specific error at verification time.
  26. }