Git-Credential-Manager-for-Windows icon indicating copy to clipboard operation
Git-Credential-Manager-for-Windows copied to clipboard

Proxy settings from PAC file fail because of missing "http://"

Open Scepheo opened this issue 7 years ago • 8 comments

If the proxy settings come from a PAC file, they will never include the "http://" protocol in front of the url. As the proxy setting from this is checked first, there is no way to override this setting (e.g. by setting the HTTP_PROXY environment variable), making GCM unusable with a PAC file.

Scepheo avatar Jun 04 '18 13:06 Scepheo

If the proxy settings come from a PAC fil

What is a "PAC file"? Sorry, I'm rather in the dark without this information.

whoisj avatar Jun 04 '18 17:06 whoisj

It's a Proxy Auto-config File. Windows can be configured to download/read such a file for the OS-level ("Internet Options") proxy settings.

Scepheo avatar Jun 05 '18 13:06 Scepheo

there is no way to override this setting (e.g. by setting the HTTP_PROXY environment variable)

What so you mean by this? Setting the HTTP_PROXY environment variable will cause the GCM to attempt to work with the proxy, but any URL will require a schema prefix (i.e. "https").

whoisj avatar Jun 05 '18 14:06 whoisj

It only checks for the HTTP_PROXY environment variable if the previous check (in LoadOperationsArguments) fails. Because the first check succeeds, none of the other options are checked, so it's impossible to use them.

A PAC file unfortunately never includes the schema prefix.

Scepheo avatar Jun 06 '18 13:06 Scepheo

A PAC file unfortunately never includes the schema prefix.

Wait, are you saying your remote url looks like

origin   foo/bar.git (fetch)
origin   foo/bar.git (push)

instead of

origin   https://foo/bar.git (fetch)
origin   https://foo/bar.git (push)

whoisj avatar Jun 06 '18 14:06 whoisj

No, my remote url looks like the latter. It's the proxy url that looks like domain.tld:8080 instead of http://domain.tld:8080. This seems to cause GCM to derive the protocol as domain.tld, instead of http.

Scepheo avatar Jun 08 '18 18:06 Scepheo

No, my remote url looks like the latter. It's the proxy url that looks like domain.tld:8080 instead of http://domain.tld:8080. This seems to cause GCM to derive the protocol as domain.tld, instead of http.

oh... hmm. Thanks, not sure what can be done but I'll try and see if there's a way to continue to leverage the NetFx proxy support and work without a URI-scheme.

whoisj avatar Jun 08 '18 18:06 whoisj

Thanks, I appreciate any effort spend on this, even if it turns out to be too difficult (or ugly) to solve. There is always the workaround of not using Git Credential Manager, so it's not a world-stopping issue.

Scepheo avatar Jun 11 '18 16:06 Scepheo