-
Notifications
You must be signed in to change notification settings - Fork 897
Unable to clone git repo while using this library. #2062
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
@Farhana0308 Looking at the details over on Stack Overflow, it's not clear to me what you mean by " Libgit2sharp uses winhttp proxy and doesnot honour internet proxy settings" In general, the underlying libgit2 library is going to use the proxy settings that git itself respects: either set in the .gitconfig file or the information set in the Do you have your proxy information configured in that way? |
@bording - Thank you for the response. Your response is highly appreciated ! |
Cloning over proxy via libgit2sharp is not possible, as there is no way to pass to libgit2 the information to use the configured proxy server via the environment variables ( |
@siprbaum - I tried the Nuget package suggested in #2043 having GitProxyOption set as Auto, still I am unable to bypass this proxy. I dont have a gitconfig set with proxy settings, libgit2sharp is considering winhttp proxy setting by default, is there a way to change this behaviour? Winhttp Proxy Setting is from organisation side, we dont have a control so need a solution to bypass this in the library. |
Are you getting some proxy settings from auto-configured through network settings or something like that? If you run On Windows, the underlying libgit2 library that LibGit2Sharp is built on uses WinHTTP, but only adds proxy settings itself if the git config is configured for a proxy (depending on the libgit2 git proxy options). However, if some external source is adding proxy settings to WinHTTP, then it does make sense that LibGit2Sharp would attempt to use that proxy. If you have a way to remove the WinHTTP proxy settings, perhaps via The good news is that libgit2 1.7 just added a new Windows Schannel http option, meaning it would no longer pick up any external WinHTTP proxy settings. I've started looking into trying to get LibGit2Sharp updated to use that, but I've run into a few roadblocks that I need to work through first. See #2064 if you're interested in some of those details. I'm also going to look into getting support for setting GitProxyOptions merged in so that it's actually possible to use the git config proxy options as you'd expect them to work. |
Thank you @bording for the response and for making the changes. As you rightly said with this new change, external winhttp proxy is not considered and we are able to proceed. |
Closing this issue as it got addressed with the latest library release. |
LibGit2Sharp 0.29.0 has been released, which includes the above mentioned libgit2 WinHTTP changes and adds proxy options to make proxies fully configurable. |
I have described the issue in detail on the stackoverflow :
https://stackoverflow.com/questions/77400787/git-clone-is-failing-with-error-code-503-while-using-libgit2sharp-library
Expected behavior
Git clone successful
Actual behavior
Git clone is failing with 503 error
Version of LibGit2Sharp (release number or SHA1)
0.26.2
Operating system(s) tested; .NET runtime tested
Windows 10; .Net 6
The text was updated successfully, but these errors were encountered: