hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: Posting XML over authenticated connection using SSL
Date Fri, 14 May 2004 12:54:25 GMT

> The problem is that your server reports an incorrect Content-Length on
> the 401 Response body.
> Count yourself: It sais 282 bytes. But the response is 283 bytes. (the
> two [0xfffd] sequences are one byte each). Nothing we can do here I fear.

Lee Francis,

I agree with Odi that incorrect Content-Length value appears to be the culprit. I see a way
to work the problem around, though. However, the workaround is likely to cost you some performance.
The problem can be solved by not re-using persistent connections. If you use HTTP/1.0 or instruct
the server to not keep the connection alive, all the garbage from the previous request will
no longer be in the way of the subsequent one

The preferred way to disable persistent connections is to send "Connection: close" directive
with the request.

Cheers,

Oleg


-----Original Message-----
From: Ortwin Glück [mailto:ortwin.glueck@nose.ch]
Sent: Friday, May 14, 2004 14:42
To: Commons HttpClient Project
Subject: Re: Posting XML over authenticated connection using SSL




Lee Francis Wilhelmsen wrote:
> - The server responds saying not authorized with a realm value
> - HTTP Client then resends the post using the credentitals
>   I have supplied (why doesn't it do this the first time?)

This is the standard behaviour. You can enable preemtive authentication.

> org.apache.commons.httpclient.HttpRecoverableException: Error in parsing
> the status  line from the response: unable to find line starting with
> "HTTP"


> DEBUG [main] httpclient.wire - << "HTTP/1.1 401 Unauthorized [\r][\n]"
> DEBUG [main] httpclient.wire - << "Server: IBM HTTP Server/V5R3M0[\r][\n]"
> DEBUG [main] httpclient.wire - << "Date: Fri, 14 May 2004 11:18:33
> GMT[\r][\n]"
> DEBUG [main] httpclient.wire - << "Accept-Ranges: bytes[\r][\n]"
> DEBUG [main] httpclient.wire - << "Content-Type: text/html;
> charset=IBM-1047[\r][\n]"
> DEBUG [main] httpclient.wire - << "Content-Length: 282[\r][\n]"
> DEBUG [main] httpclient.wire - << "Last-Modified: Fri, 14 May 2004
> 11:18:33 GMT[\r][\n]"
> DEBUG [main] httpclient.wire - << "Expires: Fri, 14 May 2004 11:18:33
> GMT[\r][\n]"
> DEBUG [main] httpclient.wire - << "Pragma: no-cache[\r][\n]"
> DEBUG [main] httpclient.wire - << "Cache-Control: no-cache[\r][\n]"
> DEBUG [main] httpclient.wire - << "WWW-Authenticate: Basic
> realm="STING_Restricted"[\r][\n]"
> DEBUG [main] httpclient.wire - << "IMW0254E
> <HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY
> bgcolor="[0xfffd][0xfffd]FFF7E7"><H1>Error 401</H1>IMW0216E Not
> authorized.  Authentication failed.<P><HR><ADDRESS><A
> HREF="https://e-torg.no.ihost.com/" target="_top">IBM HTTP Server -
> North American Edition V5R3M0</A></ADDRESS></BODY></HTML"
> DEBUG [main] httpclient.wire - >> "POST /sting/StingServlet


> Notice there is no closing ">" character and this seems to be the cause
> of this particular problem.

> Why is this happening? Can anyone help?
>
> Best regards
> Lee Francis Wilhelmsen


Lee,

The problem is that your server reports an incorrect Content-Length on
the 401 Response body.
Count yourself: It sais 282 bytes. But the response is 283 bytes. (the
two [0xfffd] sequences are one byte each). Nothing we can do here I fear.

Ortwin Glück

--
  _________________________________________________________________
  NOSE applied intelligence ag

  ortwin glück                      [www]      http://www.nose.ch
  software engineer                 [email] ortwin.glueck@nose.ch
  hardturmstrasse 171               [pgp id]           0x81CF3416
  8005 zürich                       [office]      +41-1-277 57 35
  switzerland                       [fax]         +41-1-277 57 12

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


***************************************************************************************************
The information in this email is confidential and may be legally privileged.  Access to this
email by anyone other than the intended addressee is unauthorized.  If you are not the intended
recipient of this message, any review, disclosure, copying, distribution, retention, or any
action taken or omitted to be taken in reliance on it is prohibited and may be unlawful. 
If you are not the intended recipient, please reply to or forward a copy of this message to
the sender and delete the message, any attachments, and any copies thereof from your system.
***************************************************************************************************

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


Mime
View raw message