I struggled with this when trying to use go inside a bash shell in a ubuntu22 container running inside docker desktop for windows on a corporate network.
I want to do
go get github.com/Masterminds/sprig
But kept getting x509 errors
go get github.com/Masterminds/sprig
go: github.com/Masterminds/goutils@v1.1.1: Get "https://proxy.golang.org/github.com/%21masterminds/goutils/@v/v1.1.1.mod": x509: certificate signed by unknown authority
go get --insecure
is indeed deprecated and don't work any more
export GOINSECURE=github.com
didn't work at first
it seemed to be more a combination of using GOINSECURE
with
git config --global http.sslverify false
One I'd set this sslVerify to false, it got further..
so I kept iterating the go get github.com/Masterminds/sprig
and each time it got further.. calling out another url (probably a package dependency)
go get github.com/Masterminds/sprig
go: golang.org/x/crypto@v0.0.0-20211108221036-ceb1ce70b4fa: unrecognized import path "golang.org/x/crypto": https fetch: Get "https://golang.org/x/cr
ypto?go-get=1": x509: certificate signed by unknown authority
each time I added the url to the GOINSECURE i.e.
export GOINSECURE=github.com,golang.org
go get github.com/Masterminds/sprig
go: sigs.k8s.io/yaml@v1.2.0: unrecognized import path "sigs.k8s.io/yaml": https fetch: Get "https://sigs.k8s.io/yaml?go-get=1": x509: certificate sig
ned by unknown authority
export GOINSECURE=github.com,golang.org,sigs.k8s.io
Until ultimately everything was downloaded
go get github.com/Masterminds/sprig
go: downloading github.com/Masterminds/sprig v2.22.0+incompatible
go: downloading github.com/Masterminds/goutils v1.1.1
go: downloading github.com/Masterminds/semver v1.5.0
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/huandu/xstrings v1.3.2
go: downloading github.com/imdario/mergo v0.3.12
go: downloading github.com/mitchellh/copystructure v1.2.0
go: downloading golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa
go: downloading github.com/mitchellh/reflectwalk v1.0.2
""/bin/go build prehelm.go
go: downloading sigs.k8s.io/yaml v1.2.0
go: downloading gopkg.in/yaml.v2 v2.3.0
I hope that helps, in short
- ensure you have
git config --global http.sslverify false
- add the sites to you GOINSECURE= one by one until done.
- Alternatively but less secure you can add
export GOINSECURE=*