forked from mirrors/nixpkgs
Merge pull request #24058 from LnL7/go-cacert
go: use NIX_SSL_CERT_FILE for crypto/x509
This commit is contained in:
commit
826ae5ff21
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
|
@ -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)
|
Loading…
Reference in a new issue