-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: go get -insecure fetches over http instead of https #34427
Comments
This is clearly documented:
Are you proposing that we change what the flag does? If so, wouldn't that break existing users? Imagine if a repository or custom domain doesn't support HTTPS, only HTTP. |
I see, sorry. How can I then ignore the certificate? Is there any way? |
Duplicate of #13197? If https with disabled TLS certificate checks isn't being tried first, this is probably a regression or bug. /cc @bcmills @jayconrod |
Also, please provide the output of one of the |
$ go get -v -insecure github.xxxx.xxxxx.corp/myorg/[email protected]
go: finding github.xxxx.xxxxx.corp v0.0.0-20190903123812-3090d622918c
go: finding github.xxxx.xxxxx.corp/myorg v0.0.0-20190903123812-3090d622918c
go: finding github.xxxx.xxxxx.corp/myorg/go v0.0.0-20190903123812-3090d622918c
go get github.xxxx.xxxxx.corp/myorg/[email protected]: unrecognized import path "github.xxxx.xxxxx.corp/myorg/go" (http/https fetch: Get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout) |
Ah, it looks like |
Without $ go get -x -v -insecure github.xxxx.xxxxx.corp/myorg/[email protected]
go: finding github.xxxx.xxxxx.corp/myorg/go v0.0.0-20190903123812-3090d622918c
go: finding github.xxxx.xxxxx.corp/myorg v0.0.0-20190903123812-3090d622918c
# get https://proxy.golang.org/github.xxxx.xxxxx.corp/myorg/go/@v/v0.0.0-20190903123812-3090d622918c.info
# get https://proxy.golang.org/github.xxxx.xxxxx.corp/myorg/@v/v0.0.0-20190903123812-3090d622918c.info
go: finding github.xxxx.xxxxx.corp v0.0.0-20190903123812-3090d622918c
# get https://proxy.golang.org/github.xxxx.xxxxx.corp/@v/v0.0.0-20190903123812-3090d622918c.info
# get https://proxy.golang.org/github.xxxx.xxxxx.corp/myorg/go/@v/v0.0.0-20190903123812-3090d622918c.info: 410 Gone (7.790s)
# get https://proxy.golang.org/github.xxxx.xxxxx.corp/@v/v0.0.0-20190903123812-3090d622918c.info: 410 Gone (8.441s)
# get https://proxy.golang.org/github.xxxx.xxxxx.corp/myorg/@v/v0.0.0-20190903123812-3090d622918c.info: 410 Gone (8.443s)
# get https://github.xxxx.xxxxx.corp/?go-get=1
# get https://github.xxxx.xxxxx.corp/myorg?go-get=1
# get https://github.xxxx.xxxxx.corp/myorg/go?go-get=1
# get //github.xxxx.xxxxx.corp/?go-get=1: Get https://github.xxxx.xxxxx.corp/?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get http://github.xxxx.xxxxx.corp/?go-get=1
# get //github.xxxx.xxxxx.corp/myorg?go-get=1: Get https://github.xxxx.xxxxx.corp/myorg?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get http://github.xxxx.xxxxx.corp/myorg?go-get=1
# get //github.xxxx.xxxxx.corp/myorg/go?go-get=1: Get https://github.xxxx.xxxxx.corp/myorg/go?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1
# get //github.xxxx.xxxxx.corp/myorg/go?go-get=1: Get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
# get //github.xxxx.xxxxx.corp/?go-get=1: Get http://github.xxxx.xxxxx.corp/?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
# get //github.xxxx.xxxxx.corp/myorg?go-get=1: Get http://github.xxxx.xxxxx.corp/myorg?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
go get github.xxxx.xxxxx.corp/myorg/[email protected]: unrecognized import path "github.xxxx.xxxxx.corp/myorg/go" (http/https fetch: Get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout) With $ export GOPRIVATE=github.xxxx.xxxxx.corp
$ go get -x -v -insecure github.xxxx.xxxxx.corp/myorg/[email protected]
# get https://github.xxxx.xxxxx.corp/?go-get=1
# get https://github.xxxx.xxxxx.corp/myorg/go?go-get=1
# get https://github.xxxx.xxxxx.corp/myorg?go-get=1
# get //github.xxxx.xxxxx.corp/?go-get=1: Get https://github.xxxx.xxxxx.corp/?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get //github.xxxx.xxxxx.corp/myorg/go?go-get=1: Get https://github.xxxx.xxxxx.corp/myorg/go?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1
# get //github.xxxx.xxxxx.corp/myorg?go-get=1: Get https://github.xxxx.xxxxx.corp/myorg?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get http://github.xxxx.xxxxx.corp/myorg?go-get=1
# get http://github.xxxx.xxxxx.corp/?go-get=1
# get //github.xxxx.xxxxx.corp/myorg/go?go-get=1: Get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
# get //github.xxxx.xxxxx.corp/?go-get=1: Get http://github.xxxx.xxxxx.corp/?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
# get //github.xxxx.xxxxx.corp/myorg?go-get=1: Get http://github.xxxx.xxxxx.corp/myorg?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
# get https://github.xxxx.xxxxx.corp/myorg?go-get=1
# get https://github.xxxx.xxxxx.corp/myorg/go?go-get=1
# get https://github.xxxx.xxxxx.corp/?go-get=1
# get //github.xxxx.xxxxx.corp/myorg?go-get=1: Get https://github.xxxx.xxxxx.corp/myorg?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get http://github.xxxx.xxxxx.corp/myorg?go-get=1
# get //github.xxxx.xxxxx.corp/?go-get=1: Get https://github.xxxx.xxxxx.corp/?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get http://github.xxxx.xxxxx.corp/?go-get=1
# get //github.xxxx.xxxxx.corp/myorg/go?go-get=1: Get https://github.xxxx.xxxxx.corp/myorg/go?go-get=1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
# get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1
# get //github.xxxx.xxxxx.corp/myorg?go-get=1: Get http://github.xxxx.xxxxx.corp/myorg?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
# get //github.xxxx.xxxxx.corp/?go-get=1: Get http://github.xxxx.xxxxx.corp/?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
# get //github.xxxx.xxxxx.corp/myorg/go?go-get=1: Get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout
go get github.xxxx.xxxxx.corp/myorg/[email protected]: unrecognized import path "github.xxxx.xxxxx.corp/myorg/go" (http/https fetch: Get http://github.xxxx.xxxxx.corp/myorg/go?go-get=1: dial tcp 10.XX.XX.XX:80: i/o timeout) $ curl -k https://github.xxxx.xxxxx.corp/?go-get=1
<html><body>You are being <a href="https://github.xxxx.xxxxx.corp/repositories">redirected</a>.</body></html> |
@kyroy, note that the From the trace you've provided, it appears that the |
Please try |
Hi, sorry for the delay and thanks for the investigation help :) $ curl -kL https://github.xxxx.xxxxx.corp/myorg/go?go-get=1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Go remote import path metadata</title>
<meta name="go-import" content="github.xxxx.xxxxx.corp/myorg/go git https://github.xxxx.xxxxx.corp/myorg/go.git">
<link rel="mask-icon" href="https://github.xxxx.xxxxx.corp/pinned-octocat.svg" color="#000000">
<link rel="icon" type="image/x-icon" class="js-site-favicon" href="https://github.xxxx.xxxxx.corp/favicon-ent.ico">
<meta name="theme-color" content="#1e2327">
<link rel="manifest" href="/manifest.json" crossOrigin="use-credentials">
</head>
<body>
<!-- Metadata for Go remote import path -->
</body>
</html> |
@kyroy, that doesn't really explain why the connection would be timing out. Is it possible that the server was overloaded or otherwise had very high latency? |
@bcmills Indeed I found out that there has been a bug on the infrastructure in our availability zone that the DNS server was not configured properly. Hence, there was a >5s latency. Thanks for helping. I am not sure if the error message can be improved. Otherwise, this can be closed :) (out of scope of this issue) $ go get -insecure github.xxxx.xxxxx.corp/myorg/go
go get github.xxxx.xxxxx.corp/myorg/go: git ls-remote -q https://github.xxxx.xxxxx.corp/myorg/go.git in /go/pkg/mod/cache/vcs/1e0d9b889f3416a56ea37502ad1137f6723e61f8260c10aaf3fb8c45d44204fe: exit status 128:
fatal: unable to access 'https://github.xxxx.xxxxx.corp/myorg/go.git/': server certificate verification failed. CAfile: none CRLfile: none
$ GIT_SSL_NO_VERIFY=1 go get -insecure github.xxxx.xxxxx.corp/myorg/go
go: finding github.xxxx.xxxxx.corp/myorg/go latest
go: downloading github.xxxx.xxxxx.corp/myorg/go v0.0.0-20190903123812-3090d622918c
go: extracting github.xxxx.xxxxx.corp/myorg/go v0.0.0-20190903123812-3090d622918c |
Please file that as a separate issue so that we don't lose track of it. Thanks. |
Done. Opened #34568 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Fetch the information via https but ignore the invalid certificate
What did you see instead?
Go get used http.
The text was updated successfully, but these errors were encountered: