You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <ol...@ural.ru> on 2003/04/24 21:44:06 UTC

[ATTN: Mike Becke] Baikanur, we have a problem

Mike,

Your recent patch, even though being a major hit among many users, has
unfortunately created some unpleasant side-effects for SSL tunneling on
Java 1.2.2. Java 1.4.1 appears to be subject to the problem. Apparently
in JVM 1.2.2 tunneled connection erroneously appears stale, which
prompts HttpClient to close it.

Please find below the code snippet that shows how the bug can be
reproduced, as well as the resultant wire & debug logs

Cheers

Oleg  

PS: I was just about fire this e-mail when Bin's bug report came
through. I believe it is about the same problem. 



import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.*;
import org.apache.commons.httpclient.protocol.*;
import org.apache.commons.httpclient.contrib.ssl.*;

Protocol easyhttps = new Protocol(
  "https", new EasySSLProtocolSocketFactory(), 443); 
 
HttpClient client = new HttpClient();
client.getHostConfiguration().setHost("localhost", 443, easyhttps);
client.getHostConfiguration().setProxy("localhost", 3128);
client.getState().setProxyCredentials("proxy", "localhost", new
UsernamePasswordCredentials("cache", "cache"));
GetMethod httpget = new
GetMethod("/examples/servlet/RequestHeaderExample");
client.executeMethod(httpget);
httpget.releaseConnection();

======= Debug log ===============================================

[DEBUG] HttpClient - -Java version: 1.2.2
[DEBUG] HttpClient - -Java vendor: Sun Microsystems Inc.
[DEBUG] HttpClient - -Java class path: /home/ok/workspace/Jakarta
Commons HTTP client
test/bin:/opt/eclipse/plugins/org.junit_3.8.1/junit.jar:/home/ok/src/jakarta/httpclient/bin:/home/ok/src/jakarta/httpclient/lib/commons-logging.jar
[DEBUG] HttpClient - -Operating system name: Linux
[DEBUG] HttpClient - -Operating system architecture: i386
[DEBUG] HttpClient - -Operating system version: 2.4.20-9-ok
[DEBUG] HttpClient - -SUN 1.2: SUN (DSA key/parameter generation; DSA
signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS
keystore)
[DEBUG] HttpClient - -SunJSSE 1.0301: Sun JSSE provider(implements RSA
Signatures, PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
[DEBUG] HttpConnection - -Creating connection for localhost via
localhost using protocol https:443
[DEBUG] HttpConnection - -Connection is stale, closing...
[DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0)
[DEBUG] HttpMethod - -Preemptively sending default basic credentials
[DEBUG] HttpMethod - -Execute loop try 1
[DEBUG] HttpMethod - -Adding Host request header
[DEBUG] HttpMethod - -Authorization required
[DEBUG] HttpAuthenticator - -Using 'proxy' authentication realm
[DEBUG] HttpMethod - -HttpMethodBase.execute(): Server demanded
authentication credentials, will try again.
[DEBUG] HttpMethod - -Execute loop try 2
[DEBUG] HttpConnection - -Connection is stale, closing...
[DEBUG] HttpMethod - -Opening the connection.
[DEBUG] HttpMethod - -Request to add Host header ignored: header already
added
[DEBUG] ConnectMethod - -CONNECT status code 200
[DEBUG] HttpConnection - -Secure tunnel created
[DEBUG] HttpMethod - -Preemptively sending default basic credentials
[DEBUG] HttpMethod - -Execute loop try 1
[DEBUG] HttpConnection - -Connection is stale, closing...
[DEBUG] HttpMethod - -Opening the connection.
[DEBUG] HttpMethod - -Request to add Host header ignored: header already
added
[DEBUG] HttpMethod - -Authorization required
[DEBUG] HttpAuthenticator - -Using 'proxy' authentication realm
[DEBUG] HttpMethod - -HttpMethodBase.execute(): Server demanded
authentication credentials, will try again.
[DEBUG] HttpMethod - -Should close connection since using HTTP/1.0.
[DEBUG] HttpMethod - -Execute loop try 2
[DEBUG] HttpConnection - -Connection is stale, closing...
[DEBUG] HttpMethod - -Opening the connection.
[DEBUG] HttpMethod - -Request to add Host header ignored: header already
added
[DEBUG] HttpMethod - -Should close connection since using HTTP/1.0.


======== Wire log ==================================================

[DEBUG] wire - ->> "CONNECT localhost:443 HTTP/1.1"
[DEBUG] wire - ->> "Host: localhost[\r][\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] wire - -<< "HTTP/1.0 407 Proxy Authentication Required[\r][\n]"
[DEBUG] wire - -<< "Server: squid/2.5.STABLE1[\r][\n]"
[DEBUG] wire - -<< "Mime-Version: 1.0[\r][\n]"
[DEBUG] wire - -<< "Date: Thu, 24 Apr 2003 19:19:27 GMT[\r][\n]"
[DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
[DEBUG] wire - -<< "Content-Length: 1310[\r][\n]"
[DEBUG] wire - -<< "Expires: Thu, 24 Apr 2003 19:19:27 GMT[\r][\n]"
[DEBUG] wire - -<< "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]"
[DEBUG] wire - -<< "Proxy-Authenticate: Basic realm="proxy"[\r][\n]"
[DEBUG] wire - -<< "X-Cache: MISS from
kczrh-okt22.corp.bearingpoint.com[\r][\n]"
[DEBUG] wire - -<< "Proxy-Connection: close[\r][\n]"
[DEBUG] wire - -<< "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\n]"
[DEBUG] wire - -<< "<HTML><HEAD><META HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=iso-8859-1">[\n]"
[DEBUG] wire - -<< "<TITLE>ERROR: Cache Access Denied</TITLE>[\n]"
[DEBUG] wire - -<< "<STYLE
type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>[\n]"
[DEBUG] wire - -<< "</HEAD>[\n]"
[DEBUG] wire - -<< "<BODY>[\n]"
[DEBUG] wire - -<< "<H1>ERROR</H1>[\n]"
[DEBUG] wire - -<< "<H2>Cache Access Denied</H2>[\n]"
[DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "While trying to retrieve the URL:[\n]"
[DEBUG] wire - -<< "<A HREF="localhost:443">localhost:443</A>[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "The following error was encountered:[\n]"
[DEBUG] wire - -<< "<UL>[\n]"
[DEBUG] wire - -<< "<LI>[\n]"
[DEBUG] wire - -<< "<STRONG>[\n]"
[DEBUG] wire - -<< "Cache Access Denied.[\n]"
[DEBUG] wire - -<< "</STRONG>[\n]"
[DEBUG] wire - -<< "</UL>[\n]"
[DEBUG] wire - -<< "</P>[\n]"
[DEBUG] wire - -<< "[\n]"
[DEBUG] wire - -<< "<P>Sorry, you are not currently allowed to
request:[\n]"
[DEBUG] wire - -<< "<PRE>    localhost:443</PRE>[\n]"
[DEBUG] wire - -<< "from this cache until you have authenticated
yourself.[\n]"
[DEBUG] wire - -<< "</P>[\n]"
[DEBUG] wire - -<< "[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "You need to use Netscape version 2.0 or greater, or
Microsoft Internet[\n]"
[DEBUG] wire - -<< "Explorer 3.0, or an HTTP/1.1 compliant browser for
this to work.  Please[\n]"
[DEBUG] wire - -<< "contact the <A HREF="mailto:root">cache
administrator</a> if you have[\n]"
[DEBUG] wire - -<< "difficulties authenticating yourself or [\n]"
[DEBUG] wire - -<< "<A
HREF="http://kczrh-okt22.corp.bearingpoint.com/cgi-bin/chpasswd.cgi">change</a> your default password.[\n]"
[DEBUG] wire - -<< "</P>[\n]"
[DEBUG] wire - -<< "[\n]"
[DEBUG] wire - -<< "<BR clear="all">[\n]"
[DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
[DEBUG] wire - -<< "<ADDRESS>[\n]"
[DEBUG] wire - -<< "Generated Thu, 24 Apr 2003 19:19:27 GMT by
kczrh-okt22.corp.bearingpoint.com (squid/2.5.STABLE1)[\n]"
[DEBUG] wire - -<< "</ADDRESS>[\n]"
[DEBUG] wire - -<< "</BODY></HTML>[\n]"
[DEBUG] wire - ->> "CONNECT localhost:443 HTTP/1.1"
[DEBUG] wire - ->> "Host: localhost[\r][\n]"
[DEBUG] wire - ->> "Proxy-Authorization: Basic Y2FjaGU6Y2FjaGU=[\r][\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] wire - -<< "HTTP/1.0 200 Connection established[\r][\n]"
[DEBUG] wire - ->> "GET
https://localhost/examples/servlet/RequestHeaderExample
HTTP/1.1[\r][\n]"
[DEBUG] wire - ->> "User-Agent: Jakarta
Commons-HttpClient/2.0alpha3[\r][\n]"
[DEBUG] wire - ->> "Host: localhost[\r][\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] wire - -<< "HTTP/1.0 407 Proxy Authentication Required[\r][\n]"
[DEBUG] wire - -<< "Server: squid/2.5.STABLE1[\r][\n]"
[DEBUG] wire - -<< "Mime-Version: 1.0[\r][\n]"
[DEBUG] wire - -<< "Date: Thu, 24 Apr 2003 19:19:33 GMT[\r][\n]"
[DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
[DEBUG] wire - -<< "Content-Length: 1436[\r][\n]"
[DEBUG] wire - -<< "Expires: Thu, 24 Apr 2003 19:19:33 GMT[\r][\n]"
[DEBUG] wire - -<< "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]"
[DEBUG] wire - -<< "Proxy-Authenticate: Basic realm="proxy"[\r][\n]"
[DEBUG] wire - -<< "X-Cache: MISS from
kczrh-okt22.corp.bearingpoint.com[\r][\n]"
[DEBUG] wire - -<< "Proxy-Connection: close[\r][\n]"
[DEBUG] wire - -<< "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\n]"
[DEBUG] wire - -<< "<HTML><HEAD><META HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=iso-8859-1">[\n]"
[DEBUG] wire - -<< "<TITLE>ERROR: Cache Access Denied</TITLE>[\n]"
[DEBUG] wire - -<< "<STYLE
type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>[\n]"
[DEBUG] wire - -<< "</HEAD>[\n]"
[DEBUG] wire - -<< "<BODY>[\n]"
[DEBUG] wire - -<< "<H1>ERROR</H1>[\n]"
[DEBUG] wire - -<< "<H2>Cache Access Denied</H2>[\n]"
[DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "While trying to retrieve the URL:[\n]"
[DEBUG] wire - -<< "<A
HREF="https://localhost/examples/servlet/RequestHeaderExample">https://localhost/examples/servlet/RequestHeaderExample</A>[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "The following error was encountered:[\n]"
[DEBUG] wire - -<< "<UL>[\n]"
[DEBUG] wire - -<< "<LI>[\n]"
[DEBUG] wire - -<< "<STRONG>[\n]"
[DEBUG] wire - -<< "Cache Access Denied.[\n]"
[DEBUG] wire - -<< "</STRONG>[\n]"
[DEBUG] wire - -<< "</UL>[\n]"
[DEBUG] wire - -<< "</P>[\n]"
[DEBUG] wire - -<< "[\n]"
[DEBUG] wire - -<< "<P>Sorry, you are not currently allowed to
request:[\n]"
[DEBUG] wire - -<< "<PRE>   
https://localhost/examples/servlet/RequestHeaderExample</PRE>[\n]"
[DEBUG] wire - -<< "from this cache until you have authenticated
yourself.[\n]"
[DEBUG] wire - -<< "</P>[\n]"
[DEBUG] wire - -<< "[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "You need to use Netscape version 2.0 or greater, or
Microsoft Internet[\n]"
[DEBUG] wire - -<< "Explorer 3.0, or an HTTP/1.1 compliant browser for
this to"
[DEBUG] wire - -<< " work.  Please[\n]"
[DEBUG] wire - -<< "contact the <A HREF="mailto:root">cache
administrator</a> if you have[\n]"
[DEBUG] wire - -<< "difficulties authenticating yourself or [\n]"
[DEBUG] wire - -<< "<A
HREF="http://kczrh-okt22.corp.bearingpoint.com/cgi-bin/chpasswd.cgi">change</a> your default password.[\n]"
[DEBUG] wire - -<< "</P>[\n]"
[DEBUG] wire - -<< "[\n]"
[DEBUG] wire - -<< "<BR clear="all">[\n]"
[DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
[DEBUG] wire - -<< "<ADDRESS>[\n]"
[DEBUG] wire - -<< "Generated Thu, 24 Apr 2003 19:19:33 GMT by
kczrh-okt22.corp.bearingpoint.com (squid/2.5.STABLE1)[\n]"
[DEBUG] wire - -<< "</ADDRESS>[\n]"
[DEBUG] wire - -<< "</BODY></HTML>[\n]"
[DEBUG] wire - ->> "GET
https://localhost/examples/servlet/RequestHeaderExample
HTTP/1.0[\r][\n]"
[DEBUG] wire - ->> "User-Agent: Jakarta
Commons-HttpClient/2.0alpha3[\r][\n]"
[DEBUG] wire - ->> "Host: localhost[\r][\n]"
[DEBUG] wire - ->> "Proxy-Authorization: Basic Y2FjaGU6Y2FjaGU=[\r][\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] wire - -<< "HTTP/1.0 400 Bad Request[\r][\n]"
[DEBUG] wire - -<< "Server: squid/2.5.STABLE1[\r][\n]"
[DEBUG] wire - -<< "Mime-Version: 1.0[\r][\n]"
[DEBUG] wire - -<< "Date: Thu, 24 Apr 2003 19:19:33 GMT[\r][\n]"
[DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
[DEBUG] wire - -<< "Content-Length: 1122[\r][\n]"
[DEBUG] wire - -<< "Expires: Thu, 24 Apr 2003 19:19:33 GMT[\r][\n]"
[DEBUG] wire - -<< "X-Squid-Error: ERR_UNSUP_REQ 0[\r][\n]"
[DEBUG] wire - -<< "X-Cache: MISS from
kczrh-okt22.corp.bearingpoint.com[\r][\n]"
[DEBUG] wire - -<< "Proxy-Connection: close[\r][\n]"
[DEBUG] wire - -<< "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\n]"
[DEBUG] wire - -<< "<HTML><HEAD><META HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=iso-8859-1">[\n]"
[DEBUG] wire - -<< "<TITLE>ERROR: The requested URL could not be
retrieved</TITLE>[\n]"
[DEBUG] wire - -<< "<STYLE
type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>[\n]"
[DEBUG] wire - -<< "</HEAD><BODY>[\n]"
[DEBUG] wire - -<< "<H1>ERROR</H1>[\n]"
[DEBUG] wire - -<< "<H2>The requested URL could not be
retrieved</H2>[\n]"
[DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "While trying to retrieve the URL:[\n]"
[DEBUG] wire - -<< "<A
HREF="https://localhost/examples/servlet/RequestHeaderExample">https://localhost/examples/servlet/RequestHeaderExample</A>[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "The following error was encountered:[\n]"
[DEBUG] wire - -<< "<UL>[\n]"
[DEBUG] wire - -<< "<LI>[\n]"
[DEBUG] wire - -<< "<STRONG>[\n]"
[DEBUG] wire - -<< "Unsupported Request Method and Protocol[\n]"
[DEBUG] wire - -<< "</STRONG>[\n]"
[DEBUG] wire - -<< "</UL>[\n]"
[DEBUG] wire - -<< "[\n]"
[DEBUG] wire - -<< "<P>[\n]"
[DEBUG] wire - -<< "Squid does not support all request methods for all
access protocols.[\n]"
[DEBUG] wire - -<< "For example, you can not POST a Gopher request.[\n]"
[DEBUG] wire - -<< "<P>Your cache administrator is <A
HREF="mailto:root">root</A>. [\n]"
[DEBUG] wire - -<< "[\n]"
[DEBUG] wire - -<< "<BR clear="all">[\n]"
[DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
[DEBUG] wire - -<< "<ADDRESS>[\n]"
[DEBUG] wire - -<< "Generated Thu, 24 Apr 200"
[DEBUG] wire - -<< "3 19:19:33 GMT by kczrh-okt22.corp.bearingpoint.com
(squid/2.5.STABLE1)[\n]"
[DEBUG] wire - -<< "</ADDRESS>[\n]"
[DEBUG] wire - -<< "</BODY></HTML>[\n]"




Re: [ATTN: Mike Becke] Baikanur, we have a problem

Posted by Michael Becke <be...@u.washington.edu>.
Agreed.  This may be the only way to go.  I'll try a few more things 
before I give up though.

Mike

Oleg Kalnichevski wrote:
> Mike,
> 
> The worst case scenario would be to test what platform we are running on
> and to perform state SSL connections checks on newer JVMs only (>=
> 1.4.0). I would rather openly admit and document the fact that SSL
> connection pooling works properly on JVM 1.4.1 only than keep on piling
> up messy code on top of messy code  
> 
> Oleg
> 
> 
> 
> On Thu, 2003-04-24 at 23:08, Michael Becke wrote:
> 
>>It appears to be more complicated than that.  For me, it seems that any 
>>attempt to read from an SSL connection (tunneled or not) before it has 
>>been written to causes the connection to be unusable.  This seems to 
>>apply to 1.3 and 1.2.
>>
>>For example, if we change the following in HttpConnection.isStale():
>>
>>         int byteRead = inputStream.read();
>>         if (byteRead == -1) {
>>             // again - if the socket is reporting all data read,
>>             // probably stale
>>//                            isStale = true;
>>         } else {
>>             inputStream.unread(byteRead);
>>         }
>>
>>Notice that reading a -1 no longer causes the connection to be stale. 
>>This change, though keeping the connection from being closed, caues the 
>>connection to not work for any subsequent method.
>>
>>If anyone has any ideas I would be more that happy to hear them. I will 
>>play around some more and see what I can figure out.
>>
>>Mike
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
> 


Re: [ATTN: Mike Becke] Baikanur, we have a problem

Posted by Oleg Kalnichevski <o....@dplanet.ch>.
Mike,

The worst case scenario would be to test what platform we are running on
and to perform state SSL connections checks on newer JVMs only (>=
1.4.0). I would rather openly admit and document the fact that SSL
connection pooling works properly on JVM 1.4.1 only than keep on piling
up messy code on top of messy code  

Oleg



On Thu, 2003-04-24 at 23:08, Michael Becke wrote:
> It appears to be more complicated than that.  For me, it seems that any 
> attempt to read from an SSL connection (tunneled or not) before it has 
> been written to causes the connection to be unusable.  This seems to 
> apply to 1.3 and 1.2.
> 
> For example, if we change the following in HttpConnection.isStale():
> 
>          int byteRead = inputStream.read();
>          if (byteRead == -1) {
>              // again - if the socket is reporting all data read,
>              // probably stale
> //                            isStale = true;
>          } else {
>              inputStream.unread(byteRead);
>          }
> 
> Notice that reading a -1 no longer causes the connection to be stale. 
> This change, though keeping the connection from being closed, caues the 
> connection to not work for any subsequent method.
> 
> If anyone has any ideas I would be more that happy to hear them. I will 
> play around some more and see what I can figure out.
> 
> Mike



Re: [ATTN: Mike Becke] Baikanur, we have a problem

Posted by Michael Becke <be...@u.washington.edu>.
It appears to be more complicated than that.  For me, it seems that any 
attempt to read from an SSL connection (tunneled or not) before it has 
been written to causes the connection to be unusable.  This seems to 
apply to 1.3 and 1.2.

For example, if we change the following in HttpConnection.isStale():

         int byteRead = inputStream.read();
         if (byteRead == -1) {
             // again - if the socket is reporting all data read,
             // probably stale
//                            isStale = true;
         } else {
             inputStream.unread(byteRead);
         }

Notice that reading a -1 no longer causes the connection to be stale. 
This change, though keeping the connection from being closed, caues the 
connection to not work for any subsequent method.

If anyone has any ideas I would be more that happy to hear them. I will 
play around some more and see what I can figure out.

Mike

Oleg Kalnichevski wrote:
> Mike,
> 
> Your recent patch, even though being a major hit among many users, has
> unfortunately created some unpleasant side-effects for SSL tunneling on
> Java 1.2.2. Java 1.4.1 appears to be subject to the problem. Apparently
> in JVM 1.2.2 tunneled connection erroneously appears stale, which
> prompts HttpClient to close it.
> 
> Please find below the code snippet that shows how the bug can be
> reproduced, as well as the resultant wire & debug logs
> 
> Cheers
> 
> Oleg  
> 
> PS: I was just about fire this e-mail when Bin's bug report came
> through. I believe it is about the same problem. 
> 
> 
> 
> import org.apache.commons.httpclient.*;
> import org.apache.commons.httpclient.methods.*;
> import org.apache.commons.httpclient.protocol.*;
> import org.apache.commons.httpclient.contrib.ssl.*;
> 
> Protocol easyhttps = new Protocol(
>   "https", new EasySSLProtocolSocketFactory(), 443); 
>  
> HttpClient client = new HttpClient();
> client.getHostConfiguration().setHost("localhost", 443, easyhttps);
> client.getHostConfiguration().setProxy("localhost", 3128);
> client.getState().setProxyCredentials("proxy", "localhost", new
> UsernamePasswordCredentials("cache", "cache"));
> GetMethod httpget = new
> GetMethod("/examples/servlet/RequestHeaderExample");
> client.executeMethod(httpget);
> httpget.releaseConnection();
> 
> ======= Debug log ===============================================
> 
> [DEBUG] HttpClient - -Java version: 1.2.2
> [DEBUG] HttpClient - -Java vendor: Sun Microsystems Inc.
> [DEBUG] HttpClient - -Java class path: /home/ok/workspace/Jakarta
> Commons HTTP client
> test/bin:/opt/eclipse/plugins/org.junit_3.8.1/junit.jar:/home/ok/src/jakarta/httpclient/bin:/home/ok/src/jakarta/httpclient/lib/commons-logging.jar
> [DEBUG] HttpClient - -Operating system name: Linux
> [DEBUG] HttpClient - -Operating system architecture: i386
> [DEBUG] HttpClient - -Operating system version: 2.4.20-9-ok
> [DEBUG] HttpClient - -SUN 1.2: SUN (DSA key/parameter generation; DSA
> signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS
> keystore)
> [DEBUG] HttpClient - -SunJSSE 1.0301: Sun JSSE provider(implements RSA
> Signatures, PKCS12, SunX509 key/trust factories, SSLv3, TLSv1)
> [DEBUG] HttpConnection - -Creating connection for localhost via
> localhost using protocol https:443
> [DEBUG] HttpConnection - -Connection is stale, closing...
> [DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0)
> [DEBUG] HttpMethod - -Preemptively sending default basic credentials
> [DEBUG] HttpMethod - -Execute loop try 1
> [DEBUG] HttpMethod - -Adding Host request header
> [DEBUG] HttpMethod - -Authorization required
> [DEBUG] HttpAuthenticator - -Using 'proxy' authentication realm
> [DEBUG] HttpMethod - -HttpMethodBase.execute(): Server demanded
> authentication credentials, will try again.
> [DEBUG] HttpMethod - -Execute loop try 2
> [DEBUG] HttpConnection - -Connection is stale, closing...
> [DEBUG] HttpMethod - -Opening the connection.
> [DEBUG] HttpMethod - -Request to add Host header ignored: header already
> added
> [DEBUG] ConnectMethod - -CONNECT status code 200
> [DEBUG] HttpConnection - -Secure tunnel created
> [DEBUG] HttpMethod - -Preemptively sending default basic credentials
> [DEBUG] HttpMethod - -Execute loop try 1
> [DEBUG] HttpConnection - -Connection is stale, closing...
> [DEBUG] HttpMethod - -Opening the connection.
> [DEBUG] HttpMethod - -Request to add Host header ignored: header already
> added
> [DEBUG] HttpMethod - -Authorization required
> [DEBUG] HttpAuthenticator - -Using 'proxy' authentication realm
> [DEBUG] HttpMethod - -HttpMethodBase.execute(): Server demanded
> authentication credentials, will try again.
> [DEBUG] HttpMethod - -Should close connection since using HTTP/1.0.
> [DEBUG] HttpMethod - -Execute loop try 2
> [DEBUG] HttpConnection - -Connection is stale, closing...
> [DEBUG] HttpMethod - -Opening the connection.
> [DEBUG] HttpMethod - -Request to add Host header ignored: header already
> added
> [DEBUG] HttpMethod - -Should close connection since using HTTP/1.0.
> 
> 
> ======== Wire log ==================================================
> 
> [DEBUG] wire - ->> "CONNECT localhost:443 HTTP/1.1"
> [DEBUG] wire - ->> "Host: localhost[\r][\n]"
> [DEBUG] wire - ->> "[\r][\n]"
> [DEBUG] wire - -<< "HTTP/1.0 407 Proxy Authentication Required[\r][\n]"
> [DEBUG] wire - -<< "Server: squid/2.5.STABLE1[\r][\n]"
> [DEBUG] wire - -<< "Mime-Version: 1.0[\r][\n]"
> [DEBUG] wire - -<< "Date: Thu, 24 Apr 2003 19:19:27 GMT[\r][\n]"
> [DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
> [DEBUG] wire - -<< "Content-Length: 1310[\r][\n]"
> [DEBUG] wire - -<< "Expires: Thu, 24 Apr 2003 19:19:27 GMT[\r][\n]"
> [DEBUG] wire - -<< "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]"
> [DEBUG] wire - -<< "Proxy-Authenticate: Basic realm="proxy"[\r][\n]"
> [DEBUG] wire - -<< "X-Cache: MISS from
> kczrh-okt22.corp.bearingpoint.com[\r][\n]"
> [DEBUG] wire - -<< "Proxy-Connection: close[\r][\n]"
> [DEBUG] wire - -<< "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
> Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\n]"
> [DEBUG] wire - -<< "<HTML><HEAD><META HTTP-EQUIV="Content-Type"
> CONTENT="text/html; charset=iso-8859-1">[\n]"
> [DEBUG] wire - -<< "<TITLE>ERROR: Cache Access Denied</TITLE>[\n]"
> [DEBUG] wire - -<< "<STYLE
> type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>[\n]"
> [DEBUG] wire - -<< "</HEAD>[\n]"
> [DEBUG] wire - -<< "<BODY>[\n]"
> [DEBUG] wire - -<< "<H1>ERROR</H1>[\n]"
> [DEBUG] wire - -<< "<H2>Cache Access Denied</H2>[\n]"
> [DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "While trying to retrieve the URL:[\n]"
> [DEBUG] wire - -<< "<A HREF="localhost:443">localhost:443</A>[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "The following error was encountered:[\n]"
> [DEBUG] wire - -<< "<UL>[\n]"
> [DEBUG] wire - -<< "<LI>[\n]"
> [DEBUG] wire - -<< "<STRONG>[\n]"
> [DEBUG] wire - -<< "Cache Access Denied.[\n]"
> [DEBUG] wire - -<< "</STRONG>[\n]"
> [DEBUG] wire - -<< "</UL>[\n]"
> [DEBUG] wire - -<< "</P>[\n]"
> [DEBUG] wire - -<< "[\n]"
> [DEBUG] wire - -<< "<P>Sorry, you are not currently allowed to
> request:[\n]"
> [DEBUG] wire - -<< "<PRE>    localhost:443</PRE>[\n]"
> [DEBUG] wire - -<< "from this cache until you have authenticated
> yourself.[\n]"
> [DEBUG] wire - -<< "</P>[\n]"
> [DEBUG] wire - -<< "[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "You need to use Netscape version 2.0 or greater, or
> Microsoft Internet[\n]"
> [DEBUG] wire - -<< "Explorer 3.0, or an HTTP/1.1 compliant browser for
> this to work.  Please[\n]"
> [DEBUG] wire - -<< "contact the <A HREF="mailto:root">cache
> administrator</a> if you have[\n]"
> [DEBUG] wire - -<< "difficulties authenticating yourself or [\n]"
> [DEBUG] wire - -<< "<A
> HREF="http://kczrh-okt22.corp.bearingpoint.com/cgi-bin/chpasswd.cgi">change</a> your default password.[\n]"
> [DEBUG] wire - -<< "</P>[\n]"
> [DEBUG] wire - -<< "[\n]"
> [DEBUG] wire - -<< "<BR clear="all">[\n]"
> [DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
> [DEBUG] wire - -<< "<ADDRESS>[\n]"
> [DEBUG] wire - -<< "Generated Thu, 24 Apr 2003 19:19:27 GMT by
> kczrh-okt22.corp.bearingpoint.com (squid/2.5.STABLE1)[\n]"
> [DEBUG] wire - -<< "</ADDRESS>[\n]"
> [DEBUG] wire - -<< "</BODY></HTML>[\n]"
> [DEBUG] wire - ->> "CONNECT localhost:443 HTTP/1.1"
> [DEBUG] wire - ->> "Host: localhost[\r][\n]"
> [DEBUG] wire - ->> "Proxy-Authorization: Basic Y2FjaGU6Y2FjaGU=[\r][\n]"
> [DEBUG] wire - ->> "[\r][\n]"
> [DEBUG] wire - -<< "HTTP/1.0 200 Connection established[\r][\n]"
> [DEBUG] wire - ->> "GET
> https://localhost/examples/servlet/RequestHeaderExample
> HTTP/1.1[\r][\n]"
> [DEBUG] wire - ->> "User-Agent: Jakarta
> Commons-HttpClient/2.0alpha3[\r][\n]"
> [DEBUG] wire - ->> "Host: localhost[\r][\n]"
> [DEBUG] wire - ->> "[\r][\n]"
> [DEBUG] wire - -<< "HTTP/1.0 407 Proxy Authentication Required[\r][\n]"
> [DEBUG] wire - -<< "Server: squid/2.5.STABLE1[\r][\n]"
> [DEBUG] wire - -<< "Mime-Version: 1.0[\r][\n]"
> [DEBUG] wire - -<< "Date: Thu, 24 Apr 2003 19:19:33 GMT[\r][\n]"
> [DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
> [DEBUG] wire - -<< "Content-Length: 1436[\r][\n]"
> [DEBUG] wire - -<< "Expires: Thu, 24 Apr 2003 19:19:33 GMT[\r][\n]"
> [DEBUG] wire - -<< "X-Squid-Error: ERR_CACHE_ACCESS_DENIED 0[\r][\n]"
> [DEBUG] wire - -<< "Proxy-Authenticate: Basic realm="proxy"[\r][\n]"
> [DEBUG] wire - -<< "X-Cache: MISS from
> kczrh-okt22.corp.bearingpoint.com[\r][\n]"
> [DEBUG] wire - -<< "Proxy-Connection: close[\r][\n]"
> [DEBUG] wire - -<< "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
> Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\n]"
> [DEBUG] wire - -<< "<HTML><HEAD><META HTTP-EQUIV="Content-Type"
> CONTENT="text/html; charset=iso-8859-1">[\n]"
> [DEBUG] wire - -<< "<TITLE>ERROR: Cache Access Denied</TITLE>[\n]"
> [DEBUG] wire - -<< "<STYLE
> type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>[\n]"
> [DEBUG] wire - -<< "</HEAD>[\n]"
> [DEBUG] wire - -<< "<BODY>[\n]"
> [DEBUG] wire - -<< "<H1>ERROR</H1>[\n]"
> [DEBUG] wire - -<< "<H2>Cache Access Denied</H2>[\n]"
> [DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "While trying to retrieve the URL:[\n]"
> [DEBUG] wire - -<< "<A
> HREF="https://localhost/examples/servlet/RequestHeaderExample">https://localhost/examples/servlet/RequestHeaderExample</A>[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "The following error was encountered:[\n]"
> [DEBUG] wire - -<< "<UL>[\n]"
> [DEBUG] wire - -<< "<LI>[\n]"
> [DEBUG] wire - -<< "<STRONG>[\n]"
> [DEBUG] wire - -<< "Cache Access Denied.[\n]"
> [DEBUG] wire - -<< "</STRONG>[\n]"
> [DEBUG] wire - -<< "</UL>[\n]"
> [DEBUG] wire - -<< "</P>[\n]"
> [DEBUG] wire - -<< "[\n]"
> [DEBUG] wire - -<< "<P>Sorry, you are not currently allowed to
> request:[\n]"
> [DEBUG] wire - -<< "<PRE>   
> https://localhost/examples/servlet/RequestHeaderExample</PRE>[\n]"
> [DEBUG] wire - -<< "from this cache until you have authenticated
> yourself.[\n]"
> [DEBUG] wire - -<< "</P>[\n]"
> [DEBUG] wire - -<< "[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "You need to use Netscape version 2.0 or greater, or
> Microsoft Internet[\n]"
> [DEBUG] wire - -<< "Explorer 3.0, or an HTTP/1.1 compliant browser for
> this to"
> [DEBUG] wire - -<< " work.  Please[\n]"
> [DEBUG] wire - -<< "contact the <A HREF="mailto:root">cache
> administrator</a> if you have[\n]"
> [DEBUG] wire - -<< "difficulties authenticating yourself or [\n]"
> [DEBUG] wire - -<< "<A
> HREF="http://kczrh-okt22.corp.bearingpoint.com/cgi-bin/chpasswd.cgi">change</a> your default password.[\n]"
> [DEBUG] wire - -<< "</P>[\n]"
> [DEBUG] wire - -<< "[\n]"
> [DEBUG] wire - -<< "<BR clear="all">[\n]"
> [DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
> [DEBUG] wire - -<< "<ADDRESS>[\n]"
> [DEBUG] wire - -<< "Generated Thu, 24 Apr 2003 19:19:33 GMT by
> kczrh-okt22.corp.bearingpoint.com (squid/2.5.STABLE1)[\n]"
> [DEBUG] wire - -<< "</ADDRESS>[\n]"
> [DEBUG] wire - -<< "</BODY></HTML>[\n]"
> [DEBUG] wire - ->> "GET
> https://localhost/examples/servlet/RequestHeaderExample
> HTTP/1.0[\r][\n]"
> [DEBUG] wire - ->> "User-Agent: Jakarta
> Commons-HttpClient/2.0alpha3[\r][\n]"
> [DEBUG] wire - ->> "Host: localhost[\r][\n]"
> [DEBUG] wire - ->> "Proxy-Authorization: Basic Y2FjaGU6Y2FjaGU=[\r][\n]"
> [DEBUG] wire - ->> "[\r][\n]"
> [DEBUG] wire - -<< "HTTP/1.0 400 Bad Request[\r][\n]"
> [DEBUG] wire - -<< "Server: squid/2.5.STABLE1[\r][\n]"
> [DEBUG] wire - -<< "Mime-Version: 1.0[\r][\n]"
> [DEBUG] wire - -<< "Date: Thu, 24 Apr 2003 19:19:33 GMT[\r][\n]"
> [DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
> [DEBUG] wire - -<< "Content-Length: 1122[\r][\n]"
> [DEBUG] wire - -<< "Expires: Thu, 24 Apr 2003 19:19:33 GMT[\r][\n]"
> [DEBUG] wire - -<< "X-Squid-Error: ERR_UNSUP_REQ 0[\r][\n]"
> [DEBUG] wire - -<< "X-Cache: MISS from
> kczrh-okt22.corp.bearingpoint.com[\r][\n]"
> [DEBUG] wire - -<< "Proxy-Connection: close[\r][\n]"
> [DEBUG] wire - -<< "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
> Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">[\n]"
> [DEBUG] wire - -<< "<HTML><HEAD><META HTTP-EQUIV="Content-Type"
> CONTENT="text/html; charset=iso-8859-1">[\n]"
> [DEBUG] wire - -<< "<TITLE>ERROR: The requested URL could not be
> retrieved</TITLE>[\n]"
> [DEBUG] wire - -<< "<STYLE
> type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>[\n]"
> [DEBUG] wire - -<< "</HEAD><BODY>[\n]"
> [DEBUG] wire - -<< "<H1>ERROR</H1>[\n]"
> [DEBUG] wire - -<< "<H2>The requested URL could not be
> retrieved</H2>[\n]"
> [DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "While trying to retrieve the URL:[\n]"
> [DEBUG] wire - -<< "<A
> HREF="https://localhost/examples/servlet/RequestHeaderExample">https://localhost/examples/servlet/RequestHeaderExample</A>[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "The following error was encountered:[\n]"
> [DEBUG] wire - -<< "<UL>[\n]"
> [DEBUG] wire - -<< "<LI>[\n]"
> [DEBUG] wire - -<< "<STRONG>[\n]"
> [DEBUG] wire - -<< "Unsupported Request Method and Protocol[\n]"
> [DEBUG] wire - -<< "</STRONG>[\n]"
> [DEBUG] wire - -<< "</UL>[\n]"
> [DEBUG] wire - -<< "[\n]"
> [DEBUG] wire - -<< "<P>[\n]"
> [DEBUG] wire - -<< "Squid does not support all request methods for all
> access protocols.[\n]"
> [DEBUG] wire - -<< "For example, you can not POST a Gopher request.[\n]"
> [DEBUG] wire - -<< "<P>Your cache administrator is <A
> HREF="mailto:root">root</A>. [\n]"
> [DEBUG] wire - -<< "[\n]"
> [DEBUG] wire - -<< "<BR clear="all">[\n]"
> [DEBUG] wire - -<< "<HR noshade size="1px">[\n]"
> [DEBUG] wire - -<< "<ADDRESS>[\n]"
> [DEBUG] wire - -<< "Generated Thu, 24 Apr 200"
> [DEBUG] wire - -<< "3 19:19:33 GMT by kczrh-okt22.corp.bearingpoint.com
> (squid/2.5.STABLE1)[\n]"
> [DEBUG] wire - -<< "</ADDRESS>[\n]"
> [DEBUG] wire - -<< "</BODY></HTML>[\n]"
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org
>