Merge pull request #24058 from LnL7/go-cacert

go: use NIX_SSL_CERT_FILE for crypto/x509
This commit is contained in:
Daniel Peebles 2017-03-26 11:11:05 -04:00 committed by GitHub
commit 826ae5ff21
4 changed files with 10 additions and 10 deletions

View File

@ -105,7 +105,7 @@ stdenv.mkDerivation rec {
patches =
[ ./remove-tools-1.7.patch
./cacert-1.7.patch
./ssl-cert-file-1.7.patch
./creds-test.patch
# This test checks for the wrong thing with recent tzdata. It's been fixed in master but the patch
@ -116,7 +116,7 @@ stdenv.mkDerivation rec {
})
];
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
GOOS = if stdenv.isDarwin then "darwin" else "linux";
GOARCH = if stdenv.isDarwin then "amd64"

View File

@ -107,7 +107,7 @@ stdenv.mkDerivation rec {
patches =
[ ./remove-tools-1.8.patch
./cacert-1.8.patch
./ssl-cert-file-1.8.patch
./creds-test.patch
./remove-test-pie-1.8.patch
@ -119,7 +119,7 @@ stdenv.mkDerivation rec {
})
];
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
NIX_SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
GOOS = if stdenv.isDarwin then "darwin" else "linux";
GOARCH = if stdenv.isDarwin then "amd64"

View File

@ -13,7 +13,7 @@ index a4b33c7..9700b75 100644
func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
@ -36,7 +36,7 @@ index 59b303d..d4a34ac 100644
+ roots = NewCertPool()
+ )
+
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
@ -65,7 +65,7 @@ index 7bcb3d6..3986e1a 100644
func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)

View File

@ -13,7 +13,7 @@ index a4b33c7..9700b75 100644
func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
@ -43,7 +43,7 @@ index 66cdb5e..bb28036 100644
numVerified int // number of execs of 'security verify-cert', for debug stats
)
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)
@ -67,7 +67,7 @@ index 7bcb3d6..3986e1a 100644
func loadSystemRoots() (*CertPool, error) {
roots := NewCertPool()
+ if file := os.Getenv("SSL_CERT_FILE"); file != "" {
+ if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
+ data, err := ioutil.ReadFile(file)
+ if err == nil {
+ roots.AppendCertsFromPEM(data)