GOINSECURE to enable http downlaods on packages from Github

Viewed 2372

I'm developing a CLI app at work in order to automate a couple tedious tasks, to do this I need to install a couple packages like gotp. I noticed that installing this new package into my project this error pops up.

go get github.com/xlzd/gotp
go: module github.com/xlzd/gotp: Get "https://proxy.golang.org/github.com/xlzd/gotp/@v/list": x509: certificate signed by unknown authority

I suppose this has something to do with my work PC's firewall or security configuration, since I was able to install a couple packages before the firewall was enabled on my PC. I read about the environment variable GOINSECURE which would enable go get to download packages over HTTP. So here's what I've done in my case.

export GOINSECURE="proxy.golang.org/*,github.com,github.com/*"

Still the same error pops up, am I missing something in my configuration?

1 Answers

I also encountered this error when I installed internal package, the solution is selected proper proxy, I change my GOPROXY to internal proxy site address, and made GOPRIVATE, GONOPROXY, GONOSUMDB to null value. In your case, you may attempt

GOINSECURE="proxy.golang.org/*,github.com,github.com/*"
GONOSUMDB="proxy.golang.org/*,github.com,github.com/*"
GOPRIVATE="proxy.golang.org/*,github.com,github.com/*"
Related