Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 91891 invoked from network); 13 Jun 2005 05:58:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jun 2005 05:58:38 -0000 Received: (qmail 24079 invoked by uid 500); 13 Jun 2005 05:58:37 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 24054 invoked by uid 500); 13 Jun 2005 05:58:37 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 24040 invoked by uid 99); 13 Jun 2005 05:58:37 -0000 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_40_50,HTML_MESSAGE,SPF_HELO_FAIL,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of ROLWEBER@de.ibm.com designates 195.212.29.150 as permitted sender) Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150) by apache.org (qpsmtpd/0.28) with ESMTP; Sun, 12 Jun 2005 22:58:35 -0700 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.12.10/8.12.10) with ESMTP id j5D5wMFu153888 for ; Mon, 13 Jun 2005 05:58:22 GMT Received: from d12av04.megacenter.de.ibm.com (d12av04.megacenter.de.ibm.com [9.149.165.229]) by d12nrmr1607.megacenter.de.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j5D5wL2H180952 for ; Mon, 13 Jun 2005 07:58:21 +0200 Received: from d12av04.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av04.megacenter.de.ibm.com (8.12.11/8.13.3) with ESMTP id j5D5wLk2017209 for ; Mon, 13 Jun 2005 07:58:21 +0200 Received: from d12ml067.megacenter.de.ibm.com (d12ml067.megacenter.de.ibm.com [9.149.164.162]) by d12av04.megacenter.de.ibm.com (8.12.11/8.12.11) with ESMTP id j5D5wLw7017206 for ; Mon, 13 Jun 2005 07:58:21 +0200 In-Reply-To: <20050613042358.8C4E3CDF8F@ws3-2.us4.outblaze.com> To: "HttpClient User Discussion" MIME-Version: 1.0 Subject: Re: HTTP/1.1 502 Proxy Error X-Mailer: Lotus Notes Release 6.5.3 September 14, 2004 From: Roland Weber X-MIMETrack: S/MIME Sign by Notes Client on Roland Weber/Germany/IBM(Release 6.5.3|September 14, 2004) at 13.06.2005 07:58:06, Serialize by Notes Client on Roland Weber/Germany/IBM(Release 6.5.3|September 14, 2004) at 13.06.2005 07:58:06, Serialize complete at 13.06.2005 07:58:06, S/MIME Sign failed at 13.06.2005 07:58:06: The cryptographic key was not found, Serialize by Router on D12ML067/12/M/IBM(Release 6.53HF247 | January 6, 2005) at 13/06/2005 07:58:21, Serialize complete at 13/06/2005 07:58:21 Message-ID: Date: Mon, 13 Jun 2005 07:58:20 +0200 Content-Type: multipart/alternative; boundary="=_alternative 0020C8F6C125701F_=" X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --=_alternative 0020C8F6C125701F_= Content-Type: text/plain; charset="US-ASCII" Hello Pavan, > Connect failed: HTTP/1.1 502 Proxy Error ( SSL port specified is not allowed. ) HttpClient is hitting the wrong port at the proxy. Please verify the proxy configuration you supply to HttpClient. cheers, Roland "pavan kumar" 13.06.2005 06:23 Please respond to "HttpClient User Discussion" To httpclient-user@jakarta.apache.org cc Subject HTTP/1.1 502 Proxy Error Hi All, The ProxyTunnelDemo.java program in Apache sample throws me the below error. Can some one point out what am I missing to do the Tunnelling. Will there be a problem if my proxy allows NTLM authentication. [INFO] HttpMethodDirector - -I/O exception caught when processing request: Connection aborted by peer: no further information [INFO] HttpMethodDirector - -Retrying request [INFO] HttpMethodBase - -Response content length is not known TEST org.apache.commons.httpclient.ProxyClient$ConnectResponse@5d56d5 Connect failed: HTTP/1.1 502 Proxy Error ( SSL port specified is not allowed. ) [WARN] HttpMethodBase - -Going to buffer response body of large or unknown size. Using getResponseAs Stream instead is recommended. Exception in thread "main" java.io.IOException: Stream closed at java.io.BufferedInputStream.ensureOpen(BufferedInputStream.java:123) at java.io.BufferedInputStream.read(BufferedInputStream.java:273) at java.io.FilterInputStream.read(FilterInputStream.java:114) at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:107) at java.io.FilterInputStream.read(FilterInputStream.java:93) at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:126) at org.apache.commons.httpclient.HttpMethodBase.getResponseBody(HttpMethodBase.java:684) at org.apache.commons.httpclient.HttpMethodBase.getResponseBodyAsString(HttpMethodBase.java: 735) at ProxyTunnelDemo.main(ProxyTunnelDemo.java:63) === Program ==== public class ProxyTunnelDemo { public static void main(String[] args) throws Exception { ProxyClient proxyclient = new ProxyClient(); // set the host the proxy should create a connection to // // Note: By default port 443 will be used. Some proxies only allow conections // to ports 443 and 8443. This is because the HTTP CONNECT method was intented // to be used for tunneling HTTPS. proxyclient.getHostConfiguration().setHost("www.yahoo.com"); // set the proxy host and port proxyclient.getHostConfiguration().setProxy("PROXY", 443); proxyclient.getState().setProxyCredentials( new AuthScope("PROXY",AuthScope.ANY_PORT,AuthScope.ANY_REALM,"NTLM"), new NTCredentials("inter", "test123", "PROXY", "NONE")); ProxyClient.ConnectResponse response = proxyclient.connect(); Socket s=new Socket("PROXY",443); System.out.println("TEST " + response); if (response.getSocket() != null) { Socket socket = response.getSocket(); try { Writer out = new OutputStreamWriter( socket.getOutputStream(), "ISO-8859-1"); out.write("GET http://www.yahoo.com/ HTTP/1.0\r\n"); out.write("Host: www.yahoo.com\r\n"); out.write("Agent: whatever\r\n"); out.write("\r\n"); out.flush(); BufferedReader in = new BufferedReader( new InputStreamReader(socket.getInputStream(), "ISO-8859-1")); String line = null; while ((line = in.readLine()) != null) { System.out.println(line); } } finally { socket.close(); } } else { System.out.println("Connect failed: " + response.getConnectMethod().getStatusLine()); System.out.println(response.getConnectMethod().getResponseBodyAsString()); } }} Thanks in advance Pavan kumar -- _______________________________________________ Get your free email from http://www.dellmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org --=_alternative 0020C8F6C125701F_=--