Scrive Francois PIETTE <[EMAIL PROTECTED]>:

> A user reported having problem with a server handling badly NTLM. Using the 
> option httpoNoNTLMAuth doesn't really disable NTLM. The user has derived a 
> new class from the component and has added in the constructor
>     FServerAuth = httpAuthBasic;
> Then it works.
> 
> If someone could confirm this behaviour...

I just discovered that when Arno changed FServerAuth and FProxyAuth from 
string to an ordinal type some code was modified in the wrong way.

In the PrepareNTLMAuth function the original code was:

    if (httpoNoNTLMAuth in FOptions) and
       (((FStatusCode = 401) and (CompareText(FServerAuth, 'NTLM') <> 0)) or
       ((FStatusCode = 407) and (CompareText(FProxyAuth, 'NTLM') <> 0))) then

and replaced by:

    if (httpoNoNTLMAuth in FOptions) and
       (((FStatusCode = 401) and (FServerAuth = httpAuthNtlm)) or
       ((FStatusCode = 407) and (FProxyAuth = httpAuthNtlm))) then

As you can see this is wrong. Is must be:

    if (httpoNoNTLMAuth in FOptions) and
       (((FStatusCode = 401) and (FServerAuth <> httpAuthNtlm)) or
       ((FStatusCode = 407) and (FProxyAuth <> httpAuthNtlm))) then

Similar situation in the PrepareBasicAuth function. Actually it is:

    if (httpoNoBasicAuth in FOptions) and
       (((FStatusCode = 401) and (FServerAuth = httpAuthBasic)) or
       ((FStatusCode = 407) and (FProxyAuth = httpAuthBasic))) then

but it must be:

    if (httpoNoBasicAuth in FOptions) and
       (((FStatusCode = 401) and (FServerAuth <> httpAuthBasic)) or
       ((FStatusCode = 407) and (FProxyAuth <> httpAuthBasic))) then

Another error in the DoRequestAsync procedure. Actually it is:

        if (FCtrlSocket.State = wsConnected)     and
           (FHostName        = FCurrentHost)     and
           (FPort            = FCurrentPort)     and
           (FProtocol        = FCurrentProtocol) then begin
{$IFDEF UseNTLMAuthentication}
            if FProxyAuth <> httpAuthNtlm then begin

instead the last line must be:

            if FProxyAuth = httpAuthNtlm then begin

Tell me if with these fix the problem disappear.


Bye, Maurizio.

----------------------------------------------------
This mail has been sent using Alpikom webmail system
http://www.alpikom.it

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

Reply via email to