0

How go get under Windows works? Does it has its own git command or rely on something external?

I've just downloaded the last Go for Windows, and when I do a go get, I'm getting

fatal: unable to access 'https://go.googlesource.com/net/': SSL certificate problem: unable to get local issuer certificate

Here are the details:

C:\Users\myid>go version
go version go1.13.7 windows/amd64

C:\Users\myid>go get -v golang.org/x/tools/cmd/present
get "golang.org/x/net/websocket": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at //golang.org/x/net/websocket?go-get=1
get "golang.org/x/net/websocket": verifying non-authoritative meta tag
golang.org/x/net (download)
# cd .; git clone -- https://go.googlesource.com/net C:\Users\myid\go\src\golang.org\x\net
Cloning into 'C:\Users\myid\go\src\golang.org\x\net'...
fatal: unable to access 'https://go.googlesource.com/net/': SSL certificate problem: unable to get local issuer certificate
package golang.org/x/net/websocket: exit status 128

How to fix it?

I tried to apply git config --global http.sslVerify false (from "Unable to resolve "unable to get local issuer certificate" using git on Windows with self-signed certificate"), but am getting this:

error: could not lock config file /z/.gitconfig: No such file or directory

Obviously it is from git bash as Z: is my Home drive. More on that -- I'm using git bash, which works by itself (in it's own bash environment):

$ wc /z/.gitconfig
  88  329 2435 /z/.gitconfig

However, that /z/ notation (instead of Z:) is not working under Windows CMD.

Although the quick fix works, I'm still interested to know what's the best way to keep everything in harmony under Windows for this. thx.

xpt
  • 20,363
  • 37
  • 127
  • 216
  • the issues seems to be with your git installation and not with go itself. You would need to figure out why you cannot save the config and why the certificate validation fails. If you are behind a corporate proxy (or something similar) that has a custom CA certificate the best would be adding the CA cert to your git config with http.sslCAPath. If youneed first just a quick fix you could try to use the env settings of git eg. `export GIT_SSL_NO_VERIFY=true` and the try to execute your go get command – hullarb Feb 12 '20 at 13:15
  • Thanks @hullarb, that quick fix worked, just I need to change to Windows 'syntax, `set GIT_SSL_NO_VERIFY=true`. As for git, I've updated OP. – xpt Feb 12 '20 at 14:18
  • Duplicate of https://stackoverflow.com/questions/23885449/unable-to-resolve-unable-to-get-local-issuer-certificate-using-git-on-windows – infiniteLearner Sep 09 '22 at 04:11

0 Answers0