[Hackage] #460: find the http proxy on windows more reliably

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.2.3.0 Severity: normal | Keywords: Difficulty: hard (< 1 day) | Ghcversion: 6.8.3 Platform: | ---------------------------------+------------------------------------------ Some network setups (particularly corporate ones) do not use a static proxy set in the windows registry but use [http://msdn.microsoft.com/en- us/library/aa384240%28VS.85%29.aspx "AutoProxy"]. This is a rather complex protocol involving DHCP, dns and requires a !JavaScript interpreter. However the [http://msdn.microsoft.com/en- us/library/aa384273%28VS.85%29.aspx WinHTTP] library comes with Windows as of Win2k SP3, WinXP SP1, Win2k3 and Vista. It's got a bunch of functions for dealing with this AutoProxy stuff, [http://msdn.microsoft.com/en-us/library/aa384122(VS.85).aspx including sample code]. In particular the main function we want is [http://msdn.microsoft.com/en-us/library/aa384097(VS.85).aspx WinHttpGetProxyForUrl] So we could try either statically linking to this, or perhaps doing some dynamic !GetProcAddress funky stuff. Reading more closely, it seems that this only works if the setup is using an !AutoProxy setup. This documentation may be more relevant: * [http://msdn.microsoft.com/en-us/library/aa383660(VS.85).aspx Discovery Without an Auto-Config File] * [http://msdn.microsoft.com/en-us/library/aa384096(VS.85).aspx WinHttpGetIEProxyConfigForCurrentUser] * [http://msdn.microsoft.com/en-us/library/aa384095(VS.85).aspx WinHttpGetDefaultProxyConfiguration] It seems that there are some performance issues with !AutoProxy but any caching has to be fairly careful since the proxy information can change. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Comment (by duncan): It seems that the Web Proxy Auto-Discovery (WPAD) protocol is more than a bit dodgy. The right thing to do seems to be to check either the default settings with !WinHttpGetDefaultProxyConfiguration() though this is apparently more appropriate for system service. Alternatively we check the IE settings with WinHttpGetIEProxyConfigForCurrentUser(). It may specify a number of possibilities: * direct connection (no proxy) * specific proxy (and proxy bypass list) * auto config url (url of a .pac file) * auto detect (WPAD / !AutoProxy) In the third case we can use !WinHttpGetProxyForUrl() to get the .pac file, cache it and interpret it for us each time we look up a url. We can use the !WinHttpGetProxyForUrl() function in such a way that it never tries the WPAD / !AutoProxy protocol. In the last case we either bite the bullet and try this nasty insecure protocol or we fail, or perhaps we just try a direct connection anyway and then fail. The fact that the .pac file can specify a different proxy for each URL is a bit irksome. It means we'd have to keep a WinHTTP `HINTERNET` session about for the whole time we're making a sequence of HTTP requests. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:1 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Comment (by duncan): Ugg, using the WinHTTP library requires using side-by-side assemblies and a manifest file. Currently ghc and Cabal have no support for using manifests to specify dependencies on assemblies. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:2 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Changes (by ganesh): * cc: ganesh.sittampalam@credit-suisse.com (added) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:3 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: normal | Milestone: Component: cabal-install tool | Version: 1.2.3.0 Severity: normal | Resolution: Keywords: | Difficulty: hard (< 1 day) Ghcversion: 6.8.3 | Platform: ---------------------------------+------------------------------------------ Changes (by guest): * cc: ndmitchell@gmail.com (added) -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:4 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: low | Milestone: _|_ Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: very hard (<1 week) Ghcversion: | Platform: ---------------------------------+------------------------------------------ Changes (by duncan): * priority: normal => low * difficulty: hard (< 1 day) => very hard (<1 week) * ghcversion: 6.8.3 => * version: 1.2.3.0 => * milestone: => _|_ Comment: This looks to be too hard. The workaround of setting an HTTP env var is apparently acceptable. A proper solution is not impossible but would need quite a bit of time to implement. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:5 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: low | Milestone: _|_ Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: very hard (<1 week) Ghcversion: | Platform: ---------------------------------+------------------------------------------ Comment (by guest): Bad news: while an HTTP env var would be nice to have in the short-term, long-term we would very much appreciate full proxy support. If you are working for a global system which has different users behind different proxies figuring out the appropriate one is going to be quite hard. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:6 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: low | Milestone: _|_ Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: very hard (<1 week) Ghcversion: | Platform: ---------------------------------+------------------------------------------ Comment (by guest): The previous comment was by me -- Neil -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:7 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: low | Milestone: _|_ Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: very hard (<1 week) Ghcversion: | Platform: ---------------------------------+------------------------------------------ Comment (by ganesh): The env var is in now and in the latest release, btw. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:8 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects

#460: find the http proxy on windows more reliably ---------------------------------+------------------------------------------ Reporter: duncan | Owner: Type: defect | Status: new Priority: low | Milestone: _|_ Component: cabal-install tool | Version: Severity: normal | Resolution: Keywords: | Difficulty: very hard (<1 week) Ghcversion: | Platform: ---------------------------------+------------------------------------------ Comment (by guest): Good news: I figured out how to work around all these issues (we no longer use cabal-install at all), so I have no immediate interest in this bug. -- Neil -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/460#comment:9 Hackage http://haskell.org/cabal/ Hackage: Cabal and related projects
participants (1)
-
Hackage