LEFT | RIGHT |
1 // Copyright 2013 The Go Authors. All rights reserved. | 1 // Copyright 2013 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // +build !cgo | 5 // +build !cgo |
6 | 6 |
7 package x509 | 7 package x509 |
8 | 8 |
9 import "os/exec" | 9 func initSystemRoots() { |
10 | 10 » systemRoots, _ = execSecurityRoots() |
11 func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate
, err error) { | |
12 » return nil, nil | |
13 } | 11 } |
14 | |
15 func initSystemRoots() { | |
16 roots := NewCertPool() | |
17 | |
18 cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p",
"/System/Library/Keychains/SystemRootCertificates.keychain") | |
19 data, err := cmd.Output() | |
20 if err != nil { | |
21 return | |
22 } | |
23 | |
24 roots.AppendCertsFromPEM(data) | |
25 systemRoots = roots | |
26 } | |
LEFT | RIGHT |