-
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: mod download doesn't allow insecure download #27332
Comments
@lizihuai Could you run this command and log it.
It seems that you have no letsencrypt's CA. |
@oiooj Explain that I have no CA? Why do I need a CA when I use go mod? |
@oiooj but I use curl -kv https://k8s.io:443 is success |
@lizihuai Drop the -k and the failure should occur. |
@fraenkel Drop the -k is failure . how can I do ? Why can I access other https URLs? I can't access this. |
Most OSes have added the LetsEncrypt CA as a trusted CA. |
I have the same issue for a self-generated cert on my private repository when using |
It is how https works. The client has to verify the cert returned by the server. We can explicitly choose to ignore validating the cert. |
Change https://golang.org/cl/135735 mentions this issue: |
I see in the recent change the flag has been added will this also allow it to pick up the setting in GO_FLAGS like other commands can? i.e. GOFLAGS=-insecure |
CC @FiloSottile |
If the problem is that |
(Or, to put it another way: I would prefer that we deprecate the |
I'm good either way, as long as I can add a self generated certificate for it to work. |
Seconding this. My work has a number of internal gitlab instances with self-signed certs. An |
We are dealing with this problem as well. An |
How many people would need the full |
I guess an alternative here would be to have a |
example1: in some company, use private Gitlab env, just use http and ssh, no https |
I vote for this. I filed a related issue this weekend #29059 |
I can't convince IT (a private gitlab cluster with hundreds of servers deployed in different cities, I don't know what the actual risk on the production environment), just as I can't convince you. |
Good in theory. Never seen it in practice. Just as an example, I have 7 different private CA's installed and trusted in my laptop. Not sure who manages each. Security dept. sometimes answer "that one is not mine, try with XXX dept.". Not a definition of breeze |
Seems to me this boils down to "Our Gitlab server has an invalid TLS certificate, so please disable security for every Go user in the world so we don't have to fix our certificate". |
Who has said that? |
We have mcafee web gateway in the middle which I think is causing this error and making go mod unusable. To get certs added to that infra (if that is a fix) would mean many discussion with clueless security teams that would then want to know how golang works and then likely create more roadblocks for us. Is an insecure option possible with go mod? |
I vote to close this as "works as designed". |
How about allowing an optional, non default —insecure flag? For those in environments where go mod won’t work. Seems like it would help some and hurt no one. |
I have an alternative solution but I can understand the dilemma some of these developers find themselves in. Maybe I don't understand why this is such an issue to add a flag to give support to the community that needs it in order to continue down the path that was given. Make this an optional flag or at least supply a fix that will allow those that need it as a way to progress that is realistic. I've never seen such push back on something that would be so simple to address. |
All I wanted for Christmas was the --insecure flag. |
From the discussion on the CL:
Nothing to do with antagonism or being unfriendly; it's a security issue. Using HTTPS links without actually checking the certificates gives a false sense of security. If you can't set up a verifiable TLS cert chain, you should be using a non-HTTPS URL, to make it clear that this is not a secure connection.
Then perhaps there's a good reason. |
When not on the corporate network it works fine. When on the corporate network, we have mcafee web gateway in the middle which .. i think ... needs some cert installed or adds something to the chain.. What cert I don’t know. That’s my guess. But this is huge issue for go development in my team and at my company. We are completely stuck whilst this back and forth happens. @bitfield I don’t understand why an option would be so bad. You don’t have to use it and neither does anyone else for whom it’s working fine. At least we can code. Otherwise we have to change programming languages? That’s extreme. note, the errors we are getting are on golang.org, etc, downloading crypto packages, etc (not k8s.io as in the original post). |
A global flag defeating all security is uncomfortable because users will naturally use it and go on with their day instead of reporting the specific reason they need it, which we might be able to address safely. Remember that modules support is still in experimental state, so now is the time to learn. For example:
If any of the above seem to match your use case (or not), please open a specific issue with as many details as possible of what you are trying to do and in what environment (not just the solution you want) and tag me and @bcmills. I am closing this issue to encourage per-scenario discussion, not because there are no valid use cases here. (If instead you do indeed need to defeat all security because of some security appliance, sounds like you should bring that up as an issue with your vendor as soon as possible.) |
Disappointed to see this request being closed. Many large enterprises don't manage certificates ideally for a variety of reasons. Very often developers in those environments don't have enough authority or influence to change how those enterprises manage certificates. I understand the reluctance to introduce a flag allowing users to disable part of TLS is not ideal, but reality is often not ideal. This is precisely why most tools include a Hopefully this decision is reconsidered and the |
@berniedurfee-ge We should write to the head of the golang project at google. Low level engineers dont see the big picture. |
I don't know go mod download before, I just using go get most of the time Is go mod download serve for different purpose than If that so, maybe there's different constraint or assumption? |
We have our own CA and must go through a corporate proxy. Unless I want to install our CA on every docker image I pull, I usually use an |
need -insecure |
@andesli, see http://golang.org/wiki/NoPlusOne. (Also note that this issue is closed, and we have no process in place to follow up on closed issues.) |
This issue is closed, but as I said we do want to address the use case, even if not with a blunt |
vote +1 |
@Haiyung This issue is closed. Also, please see https://golang.org/wiki/NoPlusOne. Thanks. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.11 linux/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?What did you do?
GO111MODULE=on go mod download
If possible, provide a recipe for reproducing the error.
error:
go: k8s.io/[email protected]+incompatible: unrecognized import path "k8s.io/client-go" (https fetch: Get https://k8s.io/client-go?go-get=1: x509: certificate signed by unknown authority)
go: k8s.io/[email protected]: unrecognized import path "k8s.io/api" (https fetch: Get https://k8s.io/api?go-get=1: x509: certificate signed by unknown authority)
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: