hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [httpclient] Tunnelling non-HTTP protocols through ProxyClient
Date Tue, 10 May 2005 16:07:21 GMT
Bindul,

> hostConfiguration.setHost(host, port, httpClientProtocol);

What is the value of the port parameter? If it is not 443 are you sure
the proxy has been configured to allow outgoing connections to that
port?

Oleg

On Tue, May 10, 2005 at 08:41:05PM +0530, Bindul Bhowmik (GMail) wrote:
> Hi,
> 
> I am trying to tunnel a FTP stream over an HTTP Tunnel proxy. I am
> trying to use the ProxyClient class of commons-client for that. I am
> using commons-net as my FTP Client, and have written an implementation
> of SocketFactory to be used for FTP connections over the Proxy.
> 
> Inside my SocketFactory implementation, I am getting the socket from
> ProxyClient.ConnectResponse#getSocket() class. The code I use is:
> 
> <code_snip>
>                 ProxyClient proxyClient = new ProxyClient();
> 		HostConfiguration hostConfiguration = proxyClient.getHostConfiguration();
> 		hostConfiguration.setHost(host, port, httpClientProtocol);
> 		hostConfiguration.setProxy("proxy", 8085);
> 		NTCredentials credentials = getNTCredentials("domain\\user",
> 				"password","proxy");
> 
> 		// Set the proxy credentials
> 		proxyClient.getState().setProxyCredentials(new AuthScope("proxy",
> -1), credentials);
> 		
> 		ProxyClient.ConnectResponse response = proxyClient.connect();
> 		if (response.getSocket() == null) {
> 			throw new IOException("Connection through proxy could not be opened");
> 		}
> 		
> 		return response.getSocket();
> </code_snip>
> 
> However, the getSocket() method returns null, and on setting the log
> level to FINE, the last response from the Proxy says:
> 
> <pre>
> HTTP/1.1 502 Proxy Error ( The specified Secure Sockets Layer (SSL)
> port is not allowed. ISA Server is not configured to allow SSL
> requests from this port. Most Web browsers use port 443 for SSL
> requests.  )
> </pre>
> 
> This problem is related to the ones discussed in the commons-user
> threads: http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/200504.mbox/%3c882a6a7e05041101351531c7d1@mail.gmail.com%3e
> and http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/200504.mbox/%3cOFD1167CC8.7FF51EF6-ONCA256FE8.000AFB2E@qantas.com.au%3e
> Any help in solving this would be great.
> 
> Regards,
> Bindul
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message