hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "pavan kumar" <pavanku...@dellmail.com>
Subject Re: javax.net.ssl.SSLException: Unrecognized SSL handshake.
Date Tue, 21 Jun 2005 15:31:01 GMT
Alex,

Its better u post the sample code here, so that freshers dont admit the same..

Pavan
----- Original Message -----
From: "Alexander Fairley" <alex.mail.list@gmail.com>
To: "Oleg Kalnichevski" <olegk@apache.org>, httpclient-user@jakarta.apache.org
Subject: Re: javax.net.ssl.SSLException: Unrecognized SSL handshake.
Date: Tue, 21 Jun 2005 09:20:54 -0400

> 
> Sorry, combination of not paying close attention to error messages and
> doing too many things at once. What actually occured was this:
> Running 3.0, I was attempting to fetch a url via https, although I was
> actually specifying it as http://. Under 3.0, this would automatically
> forward me to the https site and result in the SSLHandshake exception.
> I switched to 2.0.2 because the documentation and your contribution
> package for SSL(at least the one linked to in the user guide) depend
> on that version. I then ran a unit test that had produced the
> SSLHandshake exception, and no exception was thrown, so I naively
> assumed the problem was solved. The fetched page didn't look quite
> right, but I assumed that that was due to a problem with my code and
> that 2.0.2 had solved my SSL problem. On closer inspection I saw that
> what was really happening was that I simple wasn't being forward to
> the https page. I then installed your EasySSLProtocolSocket factory,
> and configured things appropriately to accept self-signed
> certificates, and was able to successfully fetch the page via https.
> One thing that I'm a bit confused about is the fact that a cursory
> inspection of the page's certificate suggested to me that it was
> issued by verisign, whom I believe is a fairly established CA. The
> exception said that the site failed to chain with the appropriate
> trust anchors, so I'm assuming that I must have some sort of http
> proxy in between me and them throwing HttpClient off.
>        Regardless, security really isn't crucial for my task, so using
> the EasySSLProtocolSocketFactory isn't a problem.  I looked at
> adepting your code to 3.0, and it didn't seem like too much, I may
> play around with that, if I do would it be reasonable to submit a
> patch on httpclient-dev? If you are interested in looking at the
> certificate that generated my exception, you can find it at the
> following URL, althought you may need to surf the reservation system
> at 'marriott.com' a bit first to stock up on live cookies.
> https://marriott.com/reservation/availabilitySearch.mi?checkInDateMonth=6%252F2005&checkInDateDay=30&checkInDate=6%252F30%252F2005&checkOutDateMonth=7%252F2005&checkOutDateDay=1&checkOutDate=7%252F1%252F2005&numberOfRooms=1&numberOfGuests=&marriottRewardsNumber=&corporateCode=&groupCode=&Find.x=14&Find.y=11&propertyCode=PVDLN&isSearch=false&WT_Ref=SrchMod_P&numberOfNights=1
> 
> 
> Alex
> 
> On 6/20/05, Oleg Kalnichevski <olegk@apache.org> wrote:
> > Alexander,
> >
> > With all due respect I really have hard time believing this. Both
> > HttpClient 2.0.x and HttpClient 3.0 simply end up calling
> > SSLSocketFactory.getDefault().createSocket(...). Neither of the stock
> > version of HttpClient applies any SSL related customization of
> > whatsoever. I just simply can't think of any reason why simple downgrade
> > from 3.0rc1 to 2.0.2 would make any difference. The problem must have
> > been somewhere else. If you can still reproduce the problem I'll happily
> > look into it
> >
> > Oleg
> >
> >
> > On Mon, 2005-06-20 at 16:02 -0400, Alexander Fairley wrote:
> > > Just for the record, I was having some SSL troubles with HttpClient
> > > 3.0rc1, specifically an exception generated by
> > > sun.security.validator.PKIXValidator, and I switched to 2.0.2 and they
> > > went away entirely.
> > >
> > > Alex
> > >
> > > On 6/20/05, Oleg Kalnichevski <olegk@apache.org> wrote:
> > > > Dennis,
> > > >
> > > > Have you tried HttpClient 3.0 by the way? If not, please do so. You may
> > > > also try your luck by testing your code with different JREs / JSSE
> > > > implementations, as the quality of JSSE code varies greatly. Beyond
> > > > that, I am afraid I no longer can be of any help. Whatever the
> > > > BlueCoat-Security-Appliance is, it may well be the cause of the problem.
> > > > This is not the most commonly used proxy software in existence, as far
> > > > as I can tell, and I do not know if it has a good record of standard
> > > > compliance.
> > > >
> > > > Oleg
> > > >
> > > > On Mon, 2005-06-20 at 14:26 -0400, Dennis.Sharpe@rich.frb.org wrote:
> > > > > Oleg,
> > > > >
> > > > > I looked at the troubleshooting guide and I still could not 
> > get my code to
> > > > > work.  I really think this must have something to do with 
> > the proxy server
> > > > > I am using.  Unfortunately, I can not avoid using it.  When I try
using
> > > > > SSL on a local server, everything works fine.  The legacy 
> > code that I have
> > > > > that still works looks like all it does is create an
> > > > > SSLTunnelSocketFactory and everything works fine to this 
> > proxy server.  Do
> > > > > you think the proxy server is returning something that 
> > HttpClient does not
> > > > > know how to handle?  The wire/context log follows:
> > > > >
> > > > > 2005/06/20 14:13:15:226 EDT [DEBUG] HttpClient - -Java version: 1.3.1
> > > > > 2005/06/20 14:13:15:226 EDT [DEBUG] HttpClient - -Java vendor: IBM
> > > > > Corporation
> > > > > 2005/06/20 14:13:15:226 EDT [DEBUG] HttpClient - -Java class path:
> > > > > <REMOVED BY DENNIS>
> > > > > 2005/06/20 14:13:15:241 EDT [DEBUG] HttpClient - -Operating 
> > system name:
> > > > > Windows XP
> > > > > 2005/06/20 14:13:15:241 EDT [DEBUG] HttpClient - -Operating system
> > > > > architecture: x86
> > > > > 2005/06/20 14:13:15:241 EDT [DEBUG] HttpClient - -Operating system
> > > > > version: 5.1
> > > > > 2005/06/20 14:13:15:241 EDT [DEBUG] HttpClient - -SUN 1.2: SUN (DSA
> > > > > key/parameter generation; DSA signing; SHA-1, MD5 digests; 
> > SecureRandom;
> > > > > X.509 certificates; JKS keystore)
> > > > > 2005/06/20 14:13:15:241 EDT [DEBUG] HttpClient - -SunJSSE 
> > 1.02: Sun JSSE
> > > > > provider(implements RSA Signatures, PKCS12, SunX509 
> > key/trust factories,
> > > > > SSLv3, TLSv1)
> > > > > 2005/06/20 14:13:15:476 EDT [DEBUG] HttpConnection -
> > > > > -HttpConnection.setSoTimeout(0)
> > > > > 2005/06/20 14:13:15:476 EDT [DEBUG] HttpMethodBase - 
> > -Execute loop try 1
> > > > > 2005/06/20 14:13:15:476 EDT [DEBUG] header - ->> "CONNECT
> > > > > us.etrade.com:443 HTTP/1.1"
> > > > > 2005/06/20 14:13:15:476 EDT [DEBUG] HttpMethodBase - 
> > -Adding Host request
> > > > > header
> > > > > 2005/06/20 14:13:15:476 EDT [DEBUG] header - ->> "User-Agent:
Jakarta
> > > > > Commons-HttpClient/2.0.2[\r][\n]"
> > > > > 2005/06/20 14:13:15:491 EDT [DEBUG] header - ->> "Host:
> > > > > us.etrade.com[\r][\n]"
> > > > > 2005/06/20 14:13:15:491 EDT [DEBUG] header - ->> "Proxy-Connection:
> > > > > Keep-Alive[\r][\n]"
> > > > > 2005/06/20 14:13:15:491 EDT [DEBUG] header - ->> "[\r][\n]"
> > > > > 2005/06/20 14:13:15:538 EDT [DEBUG] header - -<< "HTTP/1.1

> > 200 Connection
> > > > > established[\r][\n]"
> > > > > 2005/06/20 14:13:15:554 EDT [DEBUG] header - -<< "Proxy-agent:
> > > > > BlueCoat-Security-Appliance[\r][\n]"
> > > > > 2005/06/20 14:13:15:585 EDT [INFO] HttpMethodBase - -Response content
> > > > > length is not known
> > > > > 2005/06/20 14:13:15:585 EDT [DEBUG] HttpMethodBase - -Force-close
> > > > > connection: true
> > > > > 2005/06/20 14:13:15:585 EDT [DEBUG] ConnectMethod - 
> > -CONNECT status code
> > > > > 200
> > > > > 2005/06/20 14:13:21:022 EDT [DEBUG] HttpConnection - -Secure tunnel
> > > > > created
> > > > > 2005/06/20 14:13:21:022 EDT [DEBUG] HttpMethodBase - 
> > -Execute loop try 1
> > > > > 2005/06/20 14:13:21:022 EDT [DEBUG] header - ->> "GET /e/t/home
> > > > > HTTP/1.1[\r][\n]"
> > > > > 2005/06/20 14:13:21:022 EDT [DEBUG] HttpMethodBase - 
> > -Adding Host request
> > > > > header
> > > > > 2005/06/20 14:13:21:022 EDT [DEBUG] header - ->> "User-Agent:
Jakarta
> > > > > Commons-HttpClient/2.0.2[\r][\n]"
> > > > > 2005/06/20 14:13:21:022 EDT [DEBUG] header - ->> "Host:
> > > > > us.etrade.com[\r][\n]"
> > > > > javax.net.ssl.SSLException: Unrecognized SSL handshake.
> > > > >         at
> > > > > 
> > org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2319)
> > > > >         at
> > > > > 
> > org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2692)
> > > > >         at
> > > > > org.frb.rich.ipac.ui.DbFileProcessor.main(DbFileProcessor.java:220)
> > > > >
> > > > > Thanks,
> > > > > Dennis
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Oleg Kalnichevski <olegk@apache.org>
> > > > > 06/20/2005 11:42 AM
> > > > > Please respond to
> > > > > "HttpClient User Discussion" <httpclient-user@jakarta.apache.org>
> > > > >
> > > > >
> > > > > To
> > > > > httpclient-user@jakarta.apache.org
> > > > > cc
> > > > >
> > > > > Subject
> > > > > Re: javax.net.ssl.SSLException: Unrecognized SSL handshake.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Dennis,
> > > > >
> > > > > First off, take a look at the HttpClient troubleshooting guide:
> > > > >
> > > > > http://jakarta.apache.org/commons/httpclient/3.0/troubleshooting.html
> > > > >
> > > > > and follow the recommendations mentioned in the "things to 
> > try" section,
> > > > > especially with regards to "known limitations amd problems". If nothing
> > > > > helps, post a complete wire/context log of the HTTP session that
> > > > > exhibits the problem, and I'll do my best to take a look at it in
the
> > > > > coming days.
> > > > >
> > > > > Oleg
> > > > >
> > > > > On Mon, Jun 20, 2005 at 11:32:53AM -0400, Dennis.Sharpe@rich.frb.org
> > > > > wrote:
> > > > > > Oleg,
> > > > > >
> > > > > > I am still getting the handshake error.  My theory is 
> > that it does not
> > > > > > have to do with the certificates but maybe to do with 
> > tunnelling through
> > > > >
> > > > > > the proxy.  Do you know of anything else I can try?
> > > > > >
> > > > > > Thanks,
> > > > > > Dennis
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Oleg Kalnichevski <olegk@apache.org>
> > > > > > 06/20/2005 10:44 AM
> > > > > > Please respond to
> > > > > > "HttpClient User Discussion" <httpclient-user@jakarta.apache.org>
> > > > > >
> > > > > >
> > > > > > To
> > > > > > httpclient-user@jakarta.apache.org
> > > > > > cc
> > > > > >
> > > > > > Subject
> > > > > > Re: javax.net.ssl.SSLException: Unrecognized SSL handshake.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Dennis,
> > > > > >
> > > > > > Change the EasyTrustManager to trust any certificate:
> > > > > >
> > > > > > public boolean isServerTrusted(X509Certificate[] certificates)
{
> > > > > >   // like I care
> > > > > >   return true;
> > > > > > }
> > > > > >
> > > > > > If you can establish a connection to the server using this hack,
then
> > > > > > something must be wrong with your SSL context. Try following
the
> > > > > > recommendations given in the javadocs of this class 
> > (below) to set it up
> > > > > > right:
> > > > > >
> > > > > >
> > > > > 
> > http://svn.apache.org/viewcvs.cgi/jakarta/commons/proper/httpclient/trunk/src/contrib/org/apache/commons/httpclient/contrib/ssl/AuthSSLProtocolSocketFactory.java?view=markup
> > > > >
> > > > > >
> > > > > >
> > > > > > Oleg
> > > > > >
> > > > > > On Mon, Jun 20, 2005 at 10:35:03AM -0400, Dennis.Sharpe@rich.frb.org
> > > > > > wrote:
> > > > > > > Oleg,
> > > > > > >
> > > > > > > Thanks for responding.
> > > > > > >
> > > > > > > (1) I had already tried using a custom protocol (I copied
> > > > > > > EasySSLProtocolSocketFactory) and that did not help me
with my
> > > > > problem.
> > > > > > I
> > > > > > > have downloaded the certificate from etrade and included
it in my
> > > > > local
> > > > > > > keystore.  I get a different error (untrusted cert 
> > chain) if I do not
> > > > > > have
> > > > > > > the certificate loaded locally.
> > > > > > >
> > > > > > > (2) I only tried using HttpConnection directly because

> > I could not get
> > > > >
> > > > > > the
> > > > > > > code to work using HttpClient as recommended.  I 
> > changed the code back
> > > > >
> > > > > > to
> > > > > > > using HttpClient and I still get the same error.
> > > > > > >
> > > > > > > Do you have any other ideas I can try?
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Dennis
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Oleg Kalnichevski <olegk@apache.org>
> > > > > > > 06/17/2005 06:35 AM
> > > > > > > Please respond to
> > > > > > > "HttpClient User Discussion" <httpclient-user@jakarta.apache.org>
> > > > > > >
> > > > > > >
> > > > > > > To
> > > > > > > HttpClient User Discussion <httpclient-user@jakarta.apache.org>
> > > > > > > cc
> > > > > > >
> > > > > > > Subject
> > > > > > > Re: javax.net.ssl.SSLException: Unrecognized SSL handshake.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Dennis,
> > > > > > >
> > > > > > > I see several problems with your code.
> > > > > > >
> > > > > > > (1) Nowhere in your code do I see your custom protocol
being
> > > > > registered.
> > > > > > > Most likely Protocol protocol = Protocol.getProtocol(schema)
still
> > > > > > > returns the default HTTPS protocol handler, which does

> > not trust your
> > > > > > > target server
> > > > > > >
> > > > > > > (2) Generally we strongly discourage the direct use of

> > HttpConnection
> > > > > > > objects. The recommended pattern is to use HttpClient 
> > and, if needed,
> > > > > a
> > > > > > > custom connection manager if you absolutely have to do
something
> > > > > unusual
> > > > > > > with the HTTP connections. This is how your code may look:
> > > > > > >
> > > > > > > Protocol myhttps = new Protocol(
> > > > > > >         "https",
> > > > > > >         new EasySSLProtocolSocketFactory(), // can be any
custom
> > > > > > >                  socket factory
> > > > > > >         443);
> > > > > > > Protocol.registerProtocol("https", myhttps);
> > > > > > >
> > > > > > > URI uri = new
> > > > > > > URI("https://us.etrade.com/e/t/home".toCharArray());
> > > > > > >
> > > > > > > HttpClient httpagent = new HttpClient();
> > > > > > > httpagent.getHostConfiguration().setProxy("myproxy", 8080);
> > > > > > >
> > > > > > > HttpMethod method = new
> > > > > > > GetMethod(uri.toString());
> > > > > > > try {
> > > > > > >     httpagent.executeMethod(method);
> > > > > > >     if (method.getStatusCode() == HttpStatus.SC_OK) {
> > > > > > >        System.out.println(method.getResponseBodyAsString());
> > > > > > >     } else {
> > > > > > >        System.out.println("Unexpected failure: " +
> > > > > > >        method.getStatusLine().toString());
> > > > > > >     }
> > > > > > > } finally {
> > > > > > >     method.releaseConnection();
> > > > > > > }
> > > > > > >
> > > > > > > Oleg
> > > > > > >
> > > > > > > On Thu, Jun 16, 2005 at 01:20:12PM -0400, 
> > Dennis.Sharpe@rich.frb.org
> > > > > > > wrote:
> > > > > > > > I am having trouble connecting to a secure website

> > through a proxy
> > > > > > > server
> > > > > > > > using httpclient.  I have some manual code that works
using
> > > > > > > > SSLTunnelSocketFactory and I'm wondering if maybe
I am missing an
> > > > > API
> > > > > > > call
> > > > > > > > or something like that.  For testing, I am just using
the etrade
> > > > > > > website.
> > > > > > > > I changed the name of the proxy server in my code
snippet for
> > > > > security
> > > > > >
> > > > > > > > reasons.  Any ideas would be greatly appreciated.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > > Dennis
> > > > > > > >
> > > > > > > > Here is the trace output:
> > > > > > > >
> > > > > > > > 2005/06/16 13:11:16:730 EDT [TRACE] GetMethod - -enter
> > > > > > GetMethod(String)
> > > > > > > > 2005/06/16 13:11:16:824 EDT [TRACE] ConnectMethod
- -enter
> > > > > > > > ConnectMethod(HttpMethod)
> > > > > > > > 2005/06/16 13:11:16:824 EDT [TRACE] ConnectMethod
- -enter
> > > > > > > > ConnectMethod.execute(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:824 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.execute(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:824 EDT [DEBUG] HttpMethodBase
- 
> > -Execute loop
> > > > > try
> > > > > > 1
> > > > > > > > 2005/06/16 13:11:16:824 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.processRequest(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:840 EDT [TRACE] HttpMethodBase
- 
> > -Attempt number
> > > > > 1
> > > > > >
> > > > > > > to
> > > > > > > > process request
> > > > > > > > 2005/06/16 13:11:16:840 EDT [DEBUG] HttpMethodBase
- -Opening the
> > > > > > > > connection.
> > > > > > > > 2005/06/16 13:11:16:840 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.open()
> > > > > > > > 2005/06/16 13:11:16:918 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.writeRequest(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:918 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.printLine(String)
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.writeLine(byte[])
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.writeLine()
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:16:949 EDT [DEBUG] header - ->>
"CONNECT
> > > > > > > > us.etrade.com:443 HTTP/1.1"
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] ConnectMethod
- -enter
> > > > > > > > ConnectMethod.addRequestHeaders(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addUserAgentRequestHeaders(HttpState,

> > HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:949 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:949 EDT [DEBUG] HttpMethodBase
- -Adding Host
> > > > > > > request
> > > > > > > > header
> > > > > > > > 2005/06/16 13:11:16:965 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addProxyAuthorizationRequestHeader(HttpState,
> > > > > > > > HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:965 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addProxyConnectionHeader(HttpState,

> > HttpConnection)
> > > > > > > > 2005/06/16 13:11:16:965 EDT [DEBUG] header - ->>
"User-Agent:
> > > > > Jakarta
> > > > > > > > Commons-HttpClient/2.0.2[\r][\n]"
> > > > > > > > 2005/06/16 13:11:16:965 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.print(String)
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:16:996 EDT [DEBUG] header - ->>
"Host:
> > > > > > > > us.etrade.com[\r][\n]"
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.print(String)
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:16:996 EDT [DEBUG] header - ->>

> > "Proxy-Connection:
> > > > > > > > Keep-Alive[\r][\n]"
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.print(String)
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.writeLine()
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:16:996 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:17:011 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.flushRequestOutputStream()
> > > > > > > > 2005/06/16 13:11:17:011 EDT [DEBUG] header - ->>
"[\r][\n]"
> > > > > > > > 2005/06/16 13:11:17:011 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.flushRequestOutputStream()
> > > > > > > > 2005/06/16 13:11:17:011 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.readResponse(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:17:011 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.readStatusLine(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:17:011 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.readLine()
> > > > > > > > 2005/06/16 13:11:17:011 EDT [TRACE] HttpParser - -enter
> > > > > > > > HttpParser.readLine()
> > > > > > > > 2005/06/16 13:11:17:011 EDT [TRACE] HttpParser - -enter
> > > > > > > > HttpParser.readRawLine()
> > > > > > > > 2005/06/16 13:11:17:058 EDT [DEBUG] header - -<<
"HTTP/1.1 200
> > > > > > > Connection
> > > > > > > > established[\r][\n]"
> > > > > > > > 2005/06/16 13:11:17:058 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.readResponseHeaders(HttpState,HttpConnection)
> > > > > > > > 2005/06/16 13:11:17:058 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.getResponseInputStream()
> > > > > > > > 2005/06/16 13:11:17:058 EDT [TRACE] HttpParser - -enter
> > > > > > > > HeaderParser.parseHeaders(HttpConnection, HeaderGroup)
> > > > > > > > 2005/06/16 13:11:17:058 EDT [TRACE] HttpParser - -enter
> > > > > > > > HttpParser.readLine()
> > > > > > > > 2005/06/16 13:11:17:058 EDT [TRACE] HttpParser - -enter
> > > > > > > > HttpParser.readRawLine()
> > > > > > > > 2005/06/16 13:11:17:058 EDT [TRACE] HttpParser - -enter
> > > > > > > > HttpParser.readLine()
> > > > > > > > 2005/06/16 13:11:17:058 EDT [TRACE] HttpParser - -enter
> > > > > > > > HttpParser.readRawLine()
> > > > > > > > 2005/06/16 13:11:17:058 EDT [DEBUG] header - -<<
"Proxy-agent:
> > > > > > > > BlueCoat-Security-Appliance[\r][\n]"
> > > > > > > > 2005/06/16 13:11:17:074 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.processResponseHeaders(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:17:121 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.readResponseBody(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:17:121 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.readResponseBody(HttpConnection)
> > > > > > > > 2005/06/16 13:11:17:121 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.getResponseInputStream()
> > > > > > > > 2005/06/16 13:11:17:121 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.canResponseHaveBody(int)
> > > > > > > > 2005/06/16 13:11:17:121 EDT [INFO] HttpMethodBase
- -Response
> > > > > content
> > > > > > > > length is not known
> > > > > > > > 2005/06/16 13:11:17:121 EDT [DEBUG] HttpMethodBase
- -Force-close
> > > > > > > > connection: true
> > > > > > > > 2005/06/16 13:11:17:136 EDT [DEBUG] ConnectMethod
- 
> > -CONNECT status
> > > > > > code
> > > > > > >
> > > > > > > > 200
> > > > > > > > 2005/06/16 13:11:17:136 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.tunnelCreated()
> > > > > > > > 2005/06/16 13:11:22:808 EDT [DEBUG] HttpConnection
- 
> > -Secure tunnel
> > > > > > > > created
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.execute(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [DEBUG] HttpMethodBase
- 
> > -Execute loop
> > > > > try
> > > > > > 1
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.processRequest(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- 
> > -Attempt number
> > > > > 1
> > > > > >
> > > > > > > to
> > > > > > > > process request
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.writeRequest(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.writeRequestLine(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.generateRequestLine(HttpConnection,

> > String, String,
> > > > > > > String,
> > > > > > > > String)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [DEBUG] header - ->>
"GET /e/t/home
> > > > > > > > HTTP/1.1[\r][\n]"
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.print(String)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.writeRequestHeaders(HttpState,HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addRequestHeaders(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addUserAgentRequestHeaders(HttpState,

> > HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addHostRequestHeader(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [DEBUG] HttpMethodBase
- -Adding Host
> > > > > > > request
> > > > > > > > header
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addCookieRequestHeader(HttpState, HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:808 EDT [TRACE] HttpState - -enter
> > > > > > > > HttpState.getCookies()
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] CookieSpec - -enter
> > > > > > > > CookieSpecBase.match(String, int, String, boolean,
Cookie[])
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addAuthorizationRequestHeader(HttpState,
> > > > > > HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addProxyAuthorizationRequestHeader(HttpState,
> > > > > > > > HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addProxyConnectionHeader(HttpState,

> > HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpMethodBase
- -enter
> > > > > > > > HttpMethodBase.addContentLengthRequestHeader(HttpState,
> > > > > > HttpConnection)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [DEBUG] header - ->>
"User-Agent:
> > > > > Jakarta
> > > > > > > > Commons-HttpClient/2.0.2[\r][\n]"
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.print(String)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [DEBUG] header - ->>
"Host:
> > > > > > > > us.etrade.com[\r][\n]"
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.print(String)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.writeLine()
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[])
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.write(byte[], int, int)
> > > > > > > > 2005/06/16 13:11:22:824 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.flushRequestOutputStream()
> > > > > > > > 2005/06/16 13:11:22:839 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.close()
> > > > > > > > 2005/06/16 13:11:22:839 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.closeSockedAndStreams()
> > > > > > > > 2005/06/16 13:11:22:839 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.close()
> > > > > > > > 2005/06/16 13:11:22:839 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.closeSockedAndStreams()
> > > > > > > > 2005/06/16 13:11:22:839 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.close()
> > > > > > > > 2005/06/16 13:11:22:839 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.closeSockedAndStreams()
> > > > > > > > 2005/06/16 13:11:22:839 EDT [TRACE] HttpConnection
- -enter
> > > > > > > > HttpConnection.releaseConnection()
> > > > > > > > javax.net.ssl.SSLException: Unrecognized SSL handshake.
> > > > > > > >         at
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > 
> > org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2319)
> > > > > > > >         at
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > 
> > org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2692)
> > > > > > > >         at
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > 
> > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1121)
> > > > > > > >         at
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > 
> > org.apache.commons.httpclient.ConnectMethod.execute(ConnectMethod.java:205)
> > > > > > > >         at
> > > > > > > > 
> > org.frb.rich.ipac.ui.DbFileProcessor.main(DbFileProcessor.java:213)
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Here is the code snippet I am using (stolen from examples):
> > > > > > > >
> > > > > > > > URI uri = new 
> > URI("https://us.etrade.com/e/t/home".toCharArray());
> > > > > > > > String schema = uri.getScheme();
> > > > > > > > Protocol protocol = Protocol.getProtocol(schema);
> > > > > > > > HttpState state = new HttpState();
> > > > > > > > HttpMethod method = new GetMethod(uri.toString());
> > > > > > > > HttpConnection connection = new HttpConnection(uri.getHost(),
> > > > > > > > uri.getPort(), protocol);
> > > > > > > > connection.setProxyHost("myproxy");
> > > > > > > > connection.setProxyPort(8080);
> > > > > > > > method = new ConnectMethod(method);
> > > > > > > > method.execute(state, connection);
> > > > > > > > if (method.getStatusCode() == HttpStatus.SC_OK)
> > > > > > > > {
> > > > > > > >         System.out.println(method.getResponseBodyAsString());
> > > > > > > > }
> > > > > > > > else
> > > > > > > > {
> > > > > > > >         System.out.println("Unexpected failure: "
+
> > > > > > > > method.getStatusLine().toString());
> > > > > > > > }
> > > > > > > > method.releaseConnection();
> > > > > > >
> > > > > > > 
> > ---------------------------------------------------------------------
> > > > > > > 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
> > > > > >
> > > > > >
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > 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
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > 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


-- 
_______________________________________________
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


Mime
View raw message