Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ecf-dev] Filetransfer with platform proxy setting

Hi All,

I just realized that this code is probably the culprit (for httpclient provider):

   protected void setupProxy(Proxy proxy) {
       if (proxy.getType().equals(Proxy.Type.HTTP)) {
           final ProxyAddress address = proxy.getAddress();
httpClient.getHostConfiguration().setProxy(getHostFromURL(address.getHostName()), address.getPort());
           final String proxyUsername = proxy.getUsername();
           final String proxyPassword = proxy.getPassword();
           if (proxyUsername != null) {
final Credentials credentials = new UsernamePasswordCredentials(proxyUsername, proxyPassword); final AuthScope proxyAuthScope = new AuthScope(address.getHostName(), address.getPort(), AuthScope.ANY_REALM); httpClient.getState().setProxyCredentials(proxyAuthScope, credentials);
           }
       }
   }


As you can see, it only sets the proxy configuration if the Proxy.Type is HTTP (also represent HTTPS). But for SOCKS, this code won't be executed (for httpclient), and so no proxy configuration will be set up.

But the question is...what is httpclient's support for SOCKs proxying? I'll have to take a look at the javadocs to figure out whether httpclient supports socks proxying (obviously, httpclient is focussed primarily on http/https).

I found (so far) this thread WRT httpclient socks proxy handling...please let all know if you know definitively (for httpclient 3.0.1):

http://mail-archives.apache.org/mod_mbox/jakarta-httpclient-user/200701.mbox/%3c009701c73be0$be001ce0$19c909c0@K9%3e

Scott


Scott Lewis wrote:
Hi Jan,

Jan S. Rellermeyer wrote:
I just performed the filetransfer tests again with my proxy setup, this time configured through the platform settings. I did two rounds of tests, the positive test (proxy server is running,
expected behavior: tests succeed) and the negative test (proxy settings
enabled but server is down, expected behavior: tests fail).

There is one observed result that I would like to discuss. When the proxy
setting is a SOCKS proxy but the proxy server is down, the
testHttpsReceiveFile unexpectedly succeeds. I would assume it should fail because the SOCKS proxy setting is as well compulsory for http(s) transfer I think it's a bug, http transfer must not bypass a SOCKS proxy. Am I wrong?

I think you are right...probably is a bug. But truthfully, I'm not certain of the required/specified behavior in this case.

Which provider was being used for this test (i.e. httpclient or urlconnection/default provider)? The answer to this makes a difference because ultimately we depend on the httpclient or urlconnection proxy code (httpclient has it's own proxy interface, urlconnection uses System properties httpProxy, socksProxy, etc).

For URLConnection it's in: UrlConnectionRetrieveFileTransfer.setupProxy:147
For httpclient it's in: HttpClientRetrieveFileTransfer: 422

Thanks,

Scott



Cheers,
Jan.


------------------------------------------------------------
ETH Zurich, MSc Jan S. Rellermeyer,
Information and Communication Systems Research Group (IKS), Department of Computer Science, IFW B 47.1, Haldeneggsteig 4, CH–8092 Zürich Tel +41 44 632 30 38,
http://www.iks.inf.ethz.ch
------------------------------------------------------------

_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev

_______________________________________________
ecf-dev mailing list
ecf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ecf-dev



Back to the top