-
Notifications
You must be signed in to change notification settings - Fork 18k
Forcing to use git (or ssh protocol) when URL ends with .git is problematic when you want https instead #71317
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
Comments
go never uses the git protocol, the .git suffix only means to use git as the vcs, git is always invoked with https urls. |
Cool, gtk. But can you please give insight on what is happening in my setup? Then when I do go get on this URL, it pauses for very long time then eventually displays "no secured protocol found". Clearly, HTTPs is in play here. My solution also tweaks the URL using the "git config --global url."https://".insteadof" to specify HTTPs protocol. git clone on this URL(passing credentials on URL & certificate is in git SSL "trusted" cert folder) works fine, it is able to clone using the HTTPs protocol. And please, don't close it, because I am not sure that it is what it is like how you described. There may be other problems in play here, which then should be fixed. Why is git clone working using HTTPs protocol? Why is "go get" or "go mod tidy" not able to work if it uses HTTPs? Is there a "discovery" process in these commands that seem not to work? I don't want to go low-level if I don't have to, because at high level, everything is set to use HTTPs, but it is not working. If "git clone on HTTPs url" is working, why will "go get" and "go mod tidy" not working? Please respond, on next day, I will file a new issue just to get attention, because I am not sure whether anybody would look into the "closed" issue, but it seems not closed topic yet, coming from my side. |
Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
Well, it is subject to debate whether this is an issue or not. Clearly, there is an issue in the "go get" & "go mod tidy" tool because "git clone [HTTPs url on gitlab via reverse proxy]" works. You can't categorize this as a "non-issue" (not yet), it is your opinion. But on my mind, this is an issue. (relativity theory). The issue will not get fixed if you do this. Which is why perhaps it is still an issue today. I mean, if such is the treatment then most things will just be relegated for Q&A, but no real action will be done. If we need to change the title of the issue, please recommend a new title, definitely open for that. But not on closing this because there is an issue. It affects a huge set of people/use-case and GitLab is a very famous hosting sln. Imagine not being able to use that in this use-case? It is very "bigly", if you may. |
it seems quite clear is misconfiguration on your end. please use one of the forums for troubleshooting your setup, the issue tracker is not the appropriate place to do it. |
Ok, 'will go to the forums if (still) needing help in configuration. Your reply also helps us get isolation going, and thus, remove one of the variables at play. Thanks. |
More info, I found out that the "go get" (or go mod tidy in this respect) is truncating the .git suffix when it tries to communicate to the "HTTPs" remote endpoint as it tries to discover and download the module(s). Running "go get -x" to print out each step command/URL shows this:
** I am ready to open an issue on this .git suffix being truncated (after next few hrs or tomorrow morning). Because it, the ".git" suffix, should be taken as is.
This should be:
as specified in go.mod, from the "replace statement" like this:
|
I'm wondering what the solution to this is, we have To pull we use HTTPS with an access token but if I understand this correctly Golang incorrectly interprets the |
Originally posted by @grecinto in #39536
There are cases one wants to use HTTPs even if module URL ends w/ .git. Example, migration of code from GitHub to private GitLab repos. Being able to continue using HTTPs protocol on "go get" or "go mod tidy" (module fetch) will give flexibility to continue using the current code and change it to use git(ssh protocol) at a later point in time, or not at all.
The text was updated successfully, but these errors were encountered: