Skip to content
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

Can not use proxy with password #2106

Closed
Yogu opened this issue Feb 7, 2014 · 20 comments
Closed

Can not use proxy with password #2106

Yogu opened this issue Feb 7, 2014 · 20 comments

Comments

@Yogu
Copy link
Contributor

Yogu commented Feb 7, 2014

I have a global config entry like the following:

http.proxy=http://username:password@proxy.com:8080

libgit2's fetch fails with

Failed to set proxy: The parameter is incorrect.

The problem is that WINHTTP_PROXY_INFO does not support authentication for proxies (see also this question)

This is bad because official git does support authentication for proxies and thus libgit2 can not perform network operations in perfectly valid git configurations.

@nulltoken
Copy link
Member

http.proxy=http://username@password@proxy.com:8080

@Yogu Shouldn't it be http.proxy=http://username:password@proxy.com:8080 ?

@Yogu
Copy link
Contributor Author

Yogu commented Feb 7, 2014

@nulltoken Sorry, that was a typo in the issue description. The config file is correct.

@nulltoken
Copy link
Member

I can see some options with some promising names in this documentation describing the options flags supported by WinHttpSetOption

  • WINHTTP_OPTION_PROXY_PASSWORD
  • WINHTTP_OPTION_PROXY_USERNAME

/cc @phkelley

@ethomson
Copy link
Member

ethomson commented Feb 7, 2014

Indeed, win http absolutely supports proxies with passwords. We just need to set the options.

Can't look at this today but I can dig in this weekend if nobody beats me to it.

On Feb 7, 2014, at 5:26 AM, nulltoken notifications@github.com wrote:

I can see some options with some promising names in this documentation describing the options flags supported by WinHttpSetOption

WINHTTP_OPTION_PROXY_PASSWORD
WINHTTP_OPTION_PROXY_USERNAME
/cc @phkelley


Reply to this email directly or view it on GitHub.

@ghost
Copy link

ghost commented Jun 20, 2014

Did this ever get looked at?

@carlosmn
Copy link
Member

The WinHTTP transport (which is the only one which supports a proxy) does look up the proxy from the config and env variables.

@carlosmn
Copy link
Member

Closing as it seems it was actually fixed.

@nulltoken nulltoken reopened this Mar 2, 2015
@nulltoken
Copy link
Member

Reopening as it seems that we still don't extract the proxy username and password from the url that git_remote__get_http_proxy() returns

@nulltoken
Copy link
Member

@ethomson Are you still up to take a look at this? This would be a neat addition as currently libgit2 users behind a corporate proxy are compelled to rely on local proxy (eg. cntlm, ntlmaps, ...)

@nulltoken
Copy link
Member

@FeodorFitsner In order to ease the implementation of this feature, we were thinking about starting with a failing test. Would you have any idea how we could set up some kind of NTLM proxy during our AppVeyor builds? Would you know any product we could download and install to this purpose?

@FeodorFitsner
Copy link

@nulltoken
Copy link
Member

@FeodorFitsner Awesome! Thanks for the tip

@ethomson There's a chocolatey package for privoxy (which looks like supporting NTLM). Would that fit our need?

@nulltoken
Copy link
Member

Hmmm. Not sure Privoxy actually supports user authentication by itself. It supports forwarding up to a parent proxy.

@nulltoken
Copy link
Member

Another option might be DeleGate which is also available as a chocolatey package.

However, I'd really like someone with proxy skills to take another look at the manual, as I'm a bit out of my depth here.

@ethomson
Copy link
Member

Right, this is a bullet point that it has session persistence. NTLM and
Kerberos authenticate the entirety of a kept-alive session. If you are a
proxy and do not honor this notion, then you will require users to
authenticate for every request (at best). If you are painfully unaware of
connection affinity, and assume that everything is cookies and basic, then
you will mix up authenticated connections.

It looks like privoxy does not support authentication itself:

Privoxy itself does not support proxy authentication

says the manual. Which is a shame.

Does the Appveyor image have a JRE installed? If so, I may be able to make
something work.

On Fri, Apr 24, 2015 at 4:47 PM, nulltoken notifications@github.com wrote:

Another option might be DeleGate
http://www.delegate.org/delegate/Manual.htm
which is also available as
a chocolatey package https://chocolatey.org/packages/DeleGate.

However, I'd really like someone with proxy skills to take another look at
the manual, as I'm a bit out of my depth here.


Reply to this email directly or view it on GitHub
#2106 (comment).

@nulltoken
Copy link
Member

@ethomson http://www.appveyor.com/docs/installed-software states that the following are installed:

Java SE Development Kit (JDK)

  • JDK 1.7 x64 (C:\Program Files\Java\jdk1.7.0\bin - default in PATH)
  • JDK 1.7 x86 (C:\Program Files (x86)\Java\jdk1.7.0\bin)
  • JDK 1.8 x64 (C:\Program Files\Java\jdk1.8.0)
  • JDK 1.8 x86 (C:\Program Files (x86)\Java\jdk1.8.0)

@ethomson
Copy link
Member

OK, I think I have a proxy that I can bring to the party that I've used for testing previously.

@ghost
Copy link

ghost commented Apr 25, 2015 via email

@carlosmn
Copy link
Member

carlosmn commented May 7, 2015

I started looking into it, and while we can have a guess that a server will support Basic, it opens up a can of worms about whether people do want to have their password in plaintext or whether a program/user would prefer to be asked for them as needed, possibly using the same cred callbacks we already have for the endpoint.

It also opens up whether we'd like to allow the user to specify the want NTLM auth or what.

@carlosmn
Copy link
Member

Fixed as part of #3110 we now extract the auth info from caller- or config-provided urls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants