Http client digest auth bug
I'm using Delphi 10.1.
When TIdHTTP makes request with Digest authentication, first response is 401 with nonce.
TIdHTTP should make a second request with Digest response, but under some circumstances TIdDigestAuthentication is destroyed before the second request.
This bug does not happen when debugging step by step.
TIdCustomHTTP.CheckAndConnect:
if not AResponse.KeepAlive then
Disconnect;
TIdTCPConnection.Disconnect:
if Connected then // <- Look here
DisconnectNotifyPeer;
When debugging step by step, TCP socket is able to close before this moment, and DisconnectNotifyPeer is not called.
When running normally, TCP socket is still connected at this point, and Indy tries to disconnect, thus destroying Request.Authentication object, which holds digest params:
TIdTCPConnection.DisconnectNotifyPeer:
DoOnDisconnected();
DoOnDisconnected:
if Assigned(Request.Authentication) and
(Request.Authentication.CurrentStep = Request.Authentication.Steps) then
Request.Authentication.Free;
Authentication.Steps is 1 and Authentication.CurrentStep is 1 at this point.
Maybe, TIdDigestAuthentication.GetSteps should return 2?
I am having exactly the same problem. Any info when this issue will be fixed?