Open cb12991 opened 9 months ago
I'm not quite sure what the status of the proxy support is in libgit2. Can you review this thread if there are any hints? https://github.com/r-lib/gert/issues/122
I've reviewed that thread many times, but unfortunately haven't found a solution. It looks like I'll just have to avoid using gert and instead run git commands via CLI.
Sorry about that. It is difficult for me to test this because I don't have access to such a proxied windows corp network.
I think there is a setting to pick up the proxy server, but that will still require you to provide crendentials somehow. Does your proxy server itself also require authentication?
No, it just uses the server address and port number AFAIK. I think Git is using the HTTP_PROXY environment variable somehow; not sure why libgit2 is not.
@jeroen
I am also running into this. It works when I use git
CLI but not with gert::git_clone
.
Note that git config --list
returns:
http.https://github.com.proxy=http://<IP_ADDRESS>:<PORT>
http.https://github.com.proxysslcainfo=/etc/ssl/certs/local-ca.crt
Does libgit2
use these values?
Note. I am using :
> gert::libgit2_config()
$version
[1] '1.4.2'
A few findings, that hopefully help to resolve the libgit2 issue.
Based on what http.proxy
in https://git-scm.com/docs/git-config says about overriding the http_proxy
, I think git does use http_proxy
. Also, my corporate environment always worked without an explicit git config declaration, just using a set of http_proxy
and HTTP_PROXY
variables to make sure both kind of libs (those who insist on uppercase and those which insist on lowercase are happy).
it doesn't do any harm to git if a proxy var is configured in your git config.
However, despite https://github.com/libgit2/libgit2/blob/585210ab210800657ca32f843d3dc8e770c2a4d0/src/libgit2/remote.c#L1135
that looks like HTTP_PROXY & co are processed, libgit2
does not seem to respect the PROXY. Is there any way other than falling back to no-gert with system calls? Like passing the proxy var explicitly to gert::git_clone
?
I cannot connect to GitHub using https protocol. I'm behind a corporate firewall but have curl proxy environment variables set with allow connection via CLI. Any attempt with gert fails unless ssh protocol is used.
All required credentials seem to be set up correctly (PAT being stored and pulled from OS credential manager on Windows).
I've tried adding my proxy to git config under both http and https but with no success.
I understand libgit2 is used with gert but it appears that it's the only thing not recognizing the proxy config. Since it isn't packaged though I don't know how to pass the proxy settings to it for it to use. I've tried looking at similar issues online but haven't found a solution.
Created on 2024-02-06 with reprex v2.0.2