Community
Participate
Working Groups
WebClientUtil has code to setup proxy information for an HTTP connection. It appears that the getPlatformProxy() method only has code for handling unauthenticated HTTP proxies. The Eclipse preference also allows you to configure SOCKS and SSL proxy with or without authentication. It seem like it ought to support all of these.
Current work-around is to use the global proxy settings instead of the repository specific ones, but agreed that this would be nice to have.
Mik, I see the opposite. It is the global settings that do not support this. Well, technically the settings themselves do, but the Mylyn code that looks at them will only setup an HTTP proxy without authentication. I see some signs that in the repository-specific settings you will attempt to do this.
Ahhh, oops, thanks for clarifying.
Steffen is interested in investigating for 3.0.
I intend to look at this one this week.
Cool :). Implementationwise I was thinking about adding an abstract class NetworkConfiguration that should be passed to WebClientUtil and have appropriate getters for all what is needed (socks/http/ssl proxies, list of excluded hosts...) instead of adding more parameters to setupHttpClient().
Sounds good. I'll take a pass at it asap.
Created attachment 78136 [details] authenticated platform proxy support Here's a first pass at constructing the appropriate authenticated proxy from those returned by platform given a host. Steffen, if you have a minute, could you review? According to the java specs we're suppose to default to higher level proxies if available so I default to https, http (then socks). But, socks gets set by the platform if the user specifies it so for all purposes my patch configures http/s proxies with credentials if provided. Thanks.
Created attachment 78137 [details] mylyn/context/zip Context...
Patch looks good. Two remarks: - The HTTP proxy should be used for urls starting with http:// (even if an SSL proxy is also set). - The exception list only works for HTTP/HTTPS proxies but not for socks. This needs to be handled in the socket factory otherwise the default socket factory will set the socks proxy for all hosts. It's probably a good idea to take a look at the update manager code to check if/how they explictly handle this case. - If a SOCKS proxy is set by the user as well as an HTTP/HTTPS proxy both should be used (which is the case now).
Thanks for reviewing Steffen. Fixed point 1 and committed. I can confirm point 2 so currently we don't honor the exception list for SOCKS. Update site appears to use socks and upon failure retrys without the SOCKS proxy. Retry in this case appears to be handled by the sun httpclient so we will have to do this manually as you suggest.
I may not get to fixing the SOCKS exception list issue this week. Steffen, if you have time and feel like taking this on, holler.
Ok, I'll try to take a look next week.
Great.
Another thing that should be addressed: - notify repositories that use global proxy settings of changes in proxy configuration by registering a listener with IProxyService
(In reply to comment #15) > - notify repositories that use global proxy settings of changes in proxy > configuration by registering a listener with IProxyService This was fixed on bug#196444
It seems like you've changed public API, i.e. meaning of the parameter of getPlatformProxy() method. It is probably minor but need to be documented.
No, the old method still exists. The new method is missing an @since tag though.
Thanks guys. I added a since 2.1 tag to the new method and added deprecation of getPlatformProxy() to Mylyn 3.0 porting guide pending changes.
I have investigated this a bit further and come up with two optoins: - Proxy configuration can only be passed in the constructor of the Socket class. That means we need to implement a custom ProtocolSocketFactory for HttpClient similar to the one we already have. In order to get this working with SSLSocketFactory which constructs the sockets we need to establish the proxy connection ourselves and then layer the SSL protocol on top of that: Socket proxySocket = new Socket(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress("proxy", 1080))); proxySocket.bind(new InetSocketAddress(clientHost, clientPort)); proxySocket.connect(new InetSocketAddress(remoteHost, remotePort), 30); Socket socket = getSocketFactory().createSocket(proxySocket, remoteHost, remotePort, true); return socket; - Java 5.0 introduced a ProxySelector class which allows to select proxies on a host basis. Unfortunatelly it needs to be installed JVM wide and will affect all socket communication. I strongly prefer the first option and will try to implement the proposed approach by the end of this week.
Rob, I could take a pass at this during the weekend, but the changes might be to disruptive so close to the release. Since the black list is now supported for HTTP proxies and socks proxies are configurable through the global preferences I would suggest to push the remainig enhancements to the next release cycle and continue discussion on bug 202274.
Thanks for investigating Steffen, I agree with your recommendation regarding socket construction. Marking resolved. Further improvement for SOCKS handling taken up on bug#2202274.