I am using Delphi Professional 6.0 pack 2 with ICS.  I'm not sure what version 
of ICS I am using since I don't see the version number in the README.  However, 
I checked HttPProt.pas and the final comment reads:

"Oct 15, 2004 V1.71 lotauro.mauri...@dnet.it enhanced basic and NTLM
             authentifications methods. Event OnNTLMAuthStep has been
             removed."

I am trying to access a server that requires Basic Authentication.  I can 
access the server without problem using FireFox.  When I try it with THttpCli 
it hangs on the second attempt after it sends the request with the proper 
Authentication header line.  I matched the Header data up as best as I could 
between what FireFox is sending and with what THttpCli sends during a Post 
attempt.  I captured the Header and Data send and receive events and the 
Headers appear to be identical where it counts (Authorization, Content-Type, 
Accept, etc.).  Note, I configured the Headers using the THttpCli properties, 
not by modifying the data in the OnCommand event (UserName, Password, Accept, 
ContentTypePost, etc.).  I logged the transaction and I can see that THttpCli 
handles the initial 401 error, closes and reopens the connection, and makes the 
second attempt with the correct Authorization line in the Header data.  I 
matched the encoded UserName/Password to the FireFox
 session and they are identical.  However, after the request is sent with the 
Authorization data, THttpCli just hangs waiting for something until I Abort the 
connection.

Does anyone know what is going wrong here or what I can try to debug it?  I 
have included the log I captured during the THttpCli Post session.  I have 
removed the encoded UserName/Password and added comments where I thought it 
might help.

Thanks,
Robert

-------------------------------------------------------------------

RESPONSE LOG

Retrieving URL.
HttpCli1: Socket state change: Invalid state
HttpCli1: Socket state change: Invalid state
HttpCli1: Socket state change: Invalid state
HttpCli1: Socket state change: Invalid state
HttpCli1: Session connected.
HttpCli1: Socket state change: Invalid state
HttpCli1: Request Header begins.
HttpCli1: Before Header send.!
HttpCli1: Command: POST /rev.cgi HTTP/1.0
HttpCli1: Command: Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HttpCli1: Command: Content-Type: application/xml; charset=UTF-8
HttpCli1: Command: User-Agent: Mozilla/4.0 (compatible; ICS)
HttpCli1: Command: Host: 127.0.0.1
HttpCli1: Command: Pragma: no-cache
HttpCli1: Command: Content-Length: 26
HttpCli1: Request header ends.
HttpCli1: Command: 
HttpCli1: Send begins.
HttpCli1: Send data event, length: 26
HttpCli1: Send ends.

// I DO NOT GET PAST THIS POINT DURING THE AUTHORIZATION ATTEMPT.

HttpCli1: Header begins.
HttpCli1: Header Data.
HttpCli1: Header Data.
HttpCli1: Header Data.
HttpCli1: Header Data.
HttpCli1: Header Data.
HttpCli1: Header Data.
HttpCli1: Header ends.
HttpCli1: Socket state change: Invalid state
HttpCli1: Header ends.
HttpCli1: Document begins.
HttpCli1: Doc data event, length: 173
HttpCli1: Document ended.
HttpCli1: Session closed.

// ----> AUTHORIZATION ATTEMPT

HttpCli1: Socket state change: Invalid state
HttpCli1: Socket state change: Invalid state
HttpCli1: Socket state change: Invalid state
HttpCli1: Socket state change: Invalid state
HttpCli1: Session connected.
HttpCli1: Socket state change: Invalid state
HttpCli1: Request Header begins.
HttpCli1: Before Header send.!
HttpCli1: Command: POST /rev.cgi HTTP/1.0
HttpCli1: Command: Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HttpCli1: Command: Content-Type: application/xml; charset=UTF-8
HttpCli1: Command: User-Agent: Mozilla/4.0 (compatible; ICS)
HttpCli1: Command: Host: 127.0.0.1
HttpCli1: Command: Pragma: no-cache
HttpCli1: Command: Content-Length: 26
HttpCli1: Command: Authorization: Basic (encoded login details removed by me 
for privacy reasons but it matches the FireFox session)
HttpCli1: Request header ends.
HttpCli1: Command: 
HttpCli1: Send begins.
HttpCli1: Send ends.

//  THttpCli HANGS HERE.

// ------------ END RESPONSE LOG -------------------




      
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to