go: cmd/go: go mod init fails to retrieve company.github.com ssl only repositories

What version of Go are you using (go version)?

go version go1.12 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOARCH=amd64
set GOBIN=C:\git\go\bin
set GOCACHE=C:\Users\xxx\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=c:\git\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\git\notgo\engineering\veritasapi\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\xxx\AppData\Local\Temp\go-build238261902=/tmp/go-build -gno-record-gcc-switches

What did you do?

go mod init mymodule

this starts reading the current used glide.yaml to process project dependencies.

There are some imports in this go project that refer to a company located git-host which is accessible via git using private ssl certificates

for exampe in code:

import "oucompany.github.com/engineering/myrepo/package"

whereby in the glide.yaml we might have:

- package: github.ourcompany.local/engineering/go-utils
  repo: git@github.ourcompany.local:engineering/go-utils.git
  vcs: git
  subpackages:
  - env

What did you expect to see?

A properly initialized go.mod

What did you see instead?

errors/ exception thrown like:

$ go mod init veritasapi
go: creating new go.mod: module veritasapi
go: copying requirements from glide.lock
go: converting glide.lock: stat github.mycompany.local/engineering/protos@7462cb9dbaba285e3c931bc1edc0b62ebe8d005e: git fetch -f https://github.mycompany.local/engineering/protos.git refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in c:\git\go\pkg\mod\cache\vcs\5626dfafc13719b661e5e62c892d3563fa39030a15a5ca1fdcad3e06591ea342: exit status 128:
        fatal: unable to access 'https://github.mycompany.local/engineering/protos.git/': schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to check revocation because the revocation server was offline.

Also tried to change the .gitconfig setting:

[url "ssh://git@github.ourcompany.local:engineering/"]
        insteadOf = https://github.ourcompany.local/engineering/

but this does not show any noticable difference.

Also ensured the repository is available/readable on console:

>git ls-remote git@github.ourcompany.local:engineering/mygitrepo

outputs latest commit hashes

Question: how come

go mod init

is trying to access the git repository using https instead of via ssl / git@etc…?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Question: how come go mod init is trying to access the git repository using https instead of via ssl / git@etc…?

See https://golang.org/doc/faq#git_https.

/cc @bcmills