about summary refs log tree commit diff
path: root/pkgs/development/compilers/go/ssl-cert-file-1.9.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/go/ssl-cert-file-1.9.patch')
-rw-r--r--pkgs/development/compilers/go/ssl-cert-file-1.9.patch80
1 files changed, 0 insertions, 80 deletions
diff --git a/pkgs/development/compilers/go/ssl-cert-file-1.9.patch b/pkgs/development/compilers/go/ssl-cert-file-1.9.patch
deleted file mode 100644
index 3f27bc138c10..000000000000
--- a/pkgs/development/compilers/go/ssl-cert-file-1.9.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-diff --git a/src/crypto/x509/root_cgo_darwin.go b/src/crypto/x509/root_cgo_darwin.go
-index 8e80533590..31c0c666ec 100644
---- a/src/crypto/x509/root_cgo_darwin.go
-+++ b/src/crypto/x509/root_cgo_darwin.go
-@@ -201,11 +201,20 @@ int FetchPEMRoots(CFDataRef *pemRoots, CFDataRef *untrustedPemRoots) {
- import "C"
- import (
- 	"errors"
-+	"io/ioutil"
-+	"os"
- 	"unsafe"
- )
- 
- func loadSystemRoots() (*CertPool, error) {
- 	roots := NewCertPool()
-+	if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
-+		data, err := ioutil.ReadFile(file)
-+		if err == nil {
-+			roots.AppendCertsFromPEM(data)
-+			return roots, nil
-+		}
-+	}
- 
- 	var data C.CFDataRef = nil
- 	var untrustedData C.CFDataRef = nil
-diff --git a/src/crypto/x509/root_darwin.go b/src/crypto/x509/root_darwin.go
-index bc35a1cf21..21e52bec51 100644
---- a/src/crypto/x509/root_darwin.go
-+++ b/src/crypto/x509/root_darwin.go
-@@ -81,18 +81,26 @@ func execSecurityRoots() (*CertPool, error) {
- 		)
- 	}
- 
--	cmd := exec.Command("/usr/bin/security", args...)
--	data, err := cmd.Output()
--	if err != nil {
--		return nil, err
--	}
--
- 	var (
- 		mu          sync.Mutex
- 		roots       = NewCertPool()
- 		numVerified int // number of execs of 'security verify-cert', for debug stats
- 	)
- 
-+	if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
-+		data, err := ioutil.ReadFile(file)
-+		if err == nil {
-+			roots.AppendCertsFromPEM(data)
-+			return roots, nil
-+		}
-+	}
-+
-+	cmd := exec.Command("/usr/bin/security", args...)
-+	data, err := cmd.Output()
-+	if err != nil {
-+		return nil, err
-+	}
-+
- 	blockCh := make(chan *pem.Block)
- 	var wg sync.WaitGroup
- 
-diff --git a/src/crypto/x509/root_unix.go b/src/crypto/x509/root_unix.go
-index 65b5a5fdbc..c9c7ac6a74 100644
---- a/src/crypto/x509/root_unix.go
-+++ b/src/crypto/x509/root_unix.go
-@@ -37,6 +37,13 @@ func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate
- 
- func loadSystemRoots() (*CertPool, error) {
- 	roots := NewCertPool()
-+	if file := os.Getenv("NIX_SSL_CERT_FILE"); file != "" {
-+		data, err := ioutil.ReadFile(file)
-+		if err == nil {
-+			roots.AppendCertsFromPEM(data)
-+			return roots, nil
-+		}
-+	}
- 
- 	files := certFiles
- 	if f := os.Getenv(certFileEnv); f != "" {