Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 86775 invoked from network); 12 Dec 2000 12:32:00 -0000 Received: from penguin-ext.wise.edt.ericsson.se (194.237.142.110) by locus.apache.org with SMTP; 12 Dec 2000 12:32:00 -0000 Received: from esealnt409.al.sw.ericsson.se (esealnt409.al.sw.ericsson.se [153.88.251.32]) by penguin.wise.edt.ericsson.se (8.11.0/8.10.1/WIREfire-1.3) with SMTP id eBCCVuG03643 for ; Tue, 12 Dec 2000 13:31:56 +0100 (MET) Received: FROM esealnt743.al.sw.ericsson.se BY esealnt409.al.sw.ericsson.se ; Tue Dec 12 13:32:01 2000 +0100 Received: by esealnt743.al.sw.ericsson.se with Internet Mail Service (5.5.2651.58) id ; Tue, 12 Dec 2000 13:31:56 +0100 Message-ID: <0BE3EAFA8B11D3118DFC0008C75D24BE04203BF8@euktcnt011.ericsson.se> From: "Michael Cohen (ETL)" To: "'tomcat-user@jakarta.apache.org'" Subject: RE: Multiple GETs on an SSLSocket Date: Tue, 12 Dec 2000 13:31:53 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2651.58) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi Ken, Can you give me a more explicit idea of what you mean by 'chunking'? Ie the kind of stream/methods to use? Mike. > -----Original Message----- > From: horn_ken@jpmorgan.com [mailto:horn_ken@jpmorgan.com] > Sent: 12 December 2000 12:22 > To: tomcat-user@jakarta.apache.org > Subject: RE: Multiple GETs on an SSLSocket > > > > I wouldn't rely on the ready() to get this right - it will depend on > whether data has arrived in the underlying stream (native). This will > probably be system dependent ;o) The only way I've had this working > reliably is to rely on content length headers or chunking. Chunking is > probably best it you can force it. > > Ken. > > > > > > michael.cohen@etl.ericsson.se on 12/12/2000 06:27:04 > > Please respond to tomcat-user@jakarta.apache.org > > To: tomcat-user@jakarta.apache.org > cc: (bcc: Ken X Horn) > Subject: RE: Multiple GETs on an SSLSocket > > > > Hi Ken, > Thanks for your suggestion. Certainly helped but not the whole ten > yards. I found that by not reading the 'null' at the end of the buffer > the IO exception is not thrown. I did this using the ready() method of > BufferedReader. ready() returns false if there is no data in > the buffer > to be read. When it returns false I break out of the loop and send the > second > GET request to the server. So the second GET doesn't cause a > IO error. The > problem > is that it doesn't cause the second page of html to be downloaded. The > buffer just > remians in state 'not ready'. > > Right now I'm trying to get it working from the servlet and > have run into > an > unrelated problem. > > I'll let you if I find a solution. > > Thanks again. > > Mike. > > > > Have you tried this on a non-SSL connection? > > A general problem with the IO in java (afaik) is that, if you > > read from the > > stream, such that you get a -1 returned, then the stream is > > effectively > > closed. You have to reconnect (I haven't tried SSL on this, > > but a plain > > socket works like this). If you can control the sending > > response, ensure > > either the content-length is specified or the stream is > > chunked so that you > > can know when to stop reading -- avoiding getting a -1. YOu > > can then reuse > > the socket, without reconnecting. > > > > Ken > > > > > > > > > > > > michael.cohen@etl.ericsson.se on 08/12/2000 06:25:10 > > > > Please respond to tomcat-user@jakarta.apache.org > > > > To: tomcat-user@jakarta.apache.org > > cc: (bcc: Ken X Horn) > > Subject: Multiple GETs on an SSLSocket > > > > > > > > > > Hi, > > > > This is more a java/ssl question then tomcat but any ideas on > > the following > > will be > > much appreciated... > > > > I'm using a servlet (will be using a servlet at the moment > > I'm testing in a > > standalone app.) > > as a client to connect via https to a server. I've got as far > > as making the > > server trusted and performing the ssl handshake and then > > downloading the > > first html page. > > > > The problem arises when I try to write the second GET request > > and flush it > > down > > the output stream. The flush() method throws an IOException. > > I'm using the > > sample code > > provided with jsse to implement things but that sample code > > only has one > > GET request and > > so works fine. The exception comes with the second GET? > > > > Any ideas? > > > > > > Mike C. > > > > > > > > > > > > > > > > > > > > > >