Following the addition of the GOINSECURE environment variable under #32966, it is now possible to select specific hosts to access insecurely when fetching dependencies. This is much neater than the -insecure flag currently supported by go get which will download insecurely for any host.
Given we now have GOINSECURE as of go 1.14, I propose the removal -insecure from go get.
GIT_SSL_NO_VERIFY still exists when using GOINSECURE.CC @jayconrod @matloob @FiloSottile @katiehockman
I think we probably need to keep -insecure around long enough for folks to start using GOINSECURE (and report and work out any deficiencies with it), but I'd be happy to remove -insecure after that point ā say, in Go 1.16 (when every still-supported version of the Go toolchain will have GOINSECURE).
Does it make sense then to log something like ā-insecure will be deprecated soon, please consider using GOINSECUREā when someone uses the -insecure flag?
There is also the non-modules go get which doesnāt support GOINSECURE - https://github.com/golang/go/blob/master/src/cmd/go/internal/get/get.go#L391; is it worth back porting GOINSECURE into that or will that code disappear at some point?
Does it make sense then to log something like ā-insecure will be deprecated soon, please consider using GOINSECUREā when someone uses the -insecure flag?
That's a very good idea. We could start doing that as soon as Go 1.15.
There is also the non-modules go get which doesnāt support GOINSECURE - https://github.com/golang/go/blob/master/src/cmd/go/internal/get/get.go#L391; is it worth back porting GOINSECURE into that or will that code disappear at some point?
Possibly both? It shouldn't be hard to retrofit GOINSECURE into GOPATH mode, but hopefully GOPATH mode will disappear in a _similar_ timeframe anyway.
I would be up for contributing to either / both of those. Should I change the proposal to focus on these features rather than deprecation?
I think we should keep this issue focused on the proposed deprecation: we probably shouldn't warn about the flag if we aren't formally deprecating it, even if we decide to keep it for a while.
If you want to go ahead and send a CL for GOINSECURE in GOPATH mode, we can get that rolling independent of this proposal.
Ok great, should I open a proposal for that or is it fine just to work on it given itās providing feature parity with modules mode?
Just a CL is fine.
It sounds like this is on hold for having GOINSECURE apply in GOPATH mode, although it's unclear to me that significant changes to GOPATH mode would be worthwhile at this point. Please change back to Active once it is appropriate to consider the deprecation again.
I am intending on looking into GOINSECURE for GOPATH, but life and now this whole virus thing are getting in the way of my free time currently š. Iāll be sure to let you know once my free time is back on track!
In #38108, @perillo notes that if and when we deprecate the -insecure flag, we should be sure to document the different behaviors w.r.t. the checksum database. -insecure today implies GOSUMDB=off, but GOINSECURE does not imply GONOSUMDB for the same modules.
Change https://golang.org/cl/229223 mentions this issue: cmd/go/internal/modget: improve GOINSECURE docs
Change https://golang.org/cl/229758 mentions this issue: cmd/go/internal/get: add GOINSECURE support
GOINSECURE is now supported in GOPATH mode, but I'm not sure if I can remove the proposal-hold label to open this back up?
This was placed on hold until GOPATH supported GOINSECURE.
Now it does.
What do people think? Should we deprecate and then remove -insecure?
Perhaps deprecate (make it work but print a warning) in Go 1.16 and remove in Go 1.17?
I think it makes sense to deprecate the -insecure flag in 1.16 and remove it in 1.17.
Change https://golang.org/cl/255882 mentions this issue: cmd/go/internal/get: warn about -insecure deprecation
The deprecation warning is now merged :). Should we put something about it in the release notes for 1.16? What is the process for doing that, is it just a PR to edit https://github.com/golang/go/blob/master/doc/go1.16.html?
Yep, exactly.
Change https://golang.org/cl/256419 mentions this issue: cmd/go/internal/get: add -insecure deprecation to release notes
Based on the discussion above this seems like a likely accept.
(I see the code has already landed but might as well finish the process.)
Yes, sorry about that! I got keen and put up the code changes because I didn't want to miss the code freeze.
Change https://golang.org/cl/257157 mentions this issue: cmd/go/internal/get: improve -insecure deprecation docs
No change in consensus, so accepted.
(@witchard, the code freeze is not for another month, for what it's worth.)
Most helpful comment
This was placed on hold until GOPATH supported GOINSECURE.
Now it does.
What do people think? Should we deprecate and then remove -insecure?
Perhaps deprecate (make it work but print a warning) in Go 1.16 and remove in Go 1.17?