1 // Copyright 2011 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.
5 // +build freebsd linux openbsd netbsd
14 // Possible certificate files; stop after finding one.
15 var certFiles = []string{
16 "/etc/ssl/certs/ca-certificates.crt", // Linux etc
17 "/etc/pki/tls/certs/ca-bundle.crt", // Fedora/RHEL
18 "/etc/ssl/ca-bundle.pem", // OpenSUSE
19 "/etc/ssl/cert.pem", // OpenBSD
22 func initDefaultRoots() {
23 roots := x509.NewCertPool()
24 for _, file := range certFiles {
25 data, err := ioutil.ReadFile(file)
27 roots.AppendCertsFromPEM(data)
31 varDefaultRoots = roots