Board index » delphi » TIdLogFile and SSL

TIdLogFile and SSL


2004-07-16 05:40:04 PM
delphi126
When using TIdLogFile to log the traffic of TIdHTTP the send data is not
logged when using SSL. Receive data is logged fine but send data only when
not using SSL. In Indy9 this worked fine.
Philip
 
 

Re:TIdLogFile and SSL

i have ran into the same problem. would be very interested in finding out a
solution. it seems caused by the ssl iohandler.
marc
"Philip von Melle" <XXXX@XXXXX.COM>writes
Quote
When using TIdLogFile to log the traffic of TIdHTTP the send data is not
logged when using SSL. Receive data is logged fine but send data only when
not using SSL. In Indy9 this worked fine.

Philip
 

Re:TIdLogFile and SSL

"Marc Aarts" <XXXX@XXXXX.COM>writes:
Quote
i have ran into the same problem. would be very interested in finding
out a solution. it seems caused by the ssl iohandler.
Furthermore after a while I get an 'Index out of bounds.'EIdException. This
is caused from within IdGlobal.BytesToString() which in turn is called from
TIdLogBase.Receive(). All this works fine without SSL but being able to log
is even more important with SSL in my view. I would be glad if this could be
fixed. Indeed it seems to be cause by the SSL IoHandler.
 

Re:TIdLogFile and SSL

i added the following bit to the "TIdSSLIOHandlerSocketOpenSSL.WriteDirect" procedure in "IdSSLOpenSSL.pas" after the "CheckForDisconnect;" line in that procedure:
// start
if Intercept <>nil then begin
Intercept.Send(ABuffer);
end;
// end
this seems to cure it. no idea why that bit is not there in the first place.
i hope that helps.
marc
Philip von Melle <XXXX@XXXXX.COM>writes:
Quote
"Marc Aarts" <XXXX@XXXXX.COM>writes:

>i have ran into the same problem. would be very interested in finding
>out a solution. it seems caused by the ssl iohandler.

Furthermore after a while I get an 'Index out of bounds.'EIdException. This
is caused from within IdGlobal.BytesToString() which in turn is called from
TIdLogBase.Receive(). All this works fine without SSL but being able to log
is even more important with SSL in my view. I would be glad if this could be
fixed. Indeed it seems to be cause by the SSL IoHandler.
 

Re:TIdLogFile and SSL

"Marc Aarts" <XXXX@XXXXX.COM>writes:
Quote

i added the following bit to the
"TIdSSLIOHandlerSocketOpenSSL.WriteDirect" procedure in
"IdSSLOpenSSL.pas" after the "CheckForDisconnect;" line in that
procedure:

// start
if Intercept <>nil then begin
Intercept.Send(ABuffer);
end;
// end

this seems to cure it. no idea why that bit is not there in the first
place.

i hope that helps.
Thank you - it seems to work.
Another bug is in TIdSSLIOHandlerSocketOpenSSL.ReadFromSource().
The lines
if Intercept <>nil then begin
Intercept.Receive(LBuffer);
LByteCount := Length(LBuffer);
end;
should ONLY be executed if LByteCount>0 (like in
TIdIOHandlerStack.ReadFromSource()) - and maybe also the following
FRecvBuffer.Write(LBuffer);
I don't know.
This caused me an 'Index out of bounds.' EIdException.
Philip