Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Using TIdDigestAuthentication

www.cryer.info
Managed Newsgroup Archive

Using TIdDigestAuthentication

Subject:Using TIdDigestAuthentication
Posted by:"Kees Vermeulen" (in..@kever.com)
Date:Fri, 9 Jun 2006 15:32:08

Hello,

I'm trying to connect to a proxy server using 'Digest' authentication. I
have the following code setup:

var
   Http: TIdHttp;

begin
   Http := TidHttp.Create;
   Http.HTTPOptions := Result.HTTPOptions + [hoInProcessAuth];
   Http.ProxyParams.ProxyServer := <ip-address>;
   Http.ProxyParams.ProxyPort := 8080;
    
   Http.OnSelectProxyAuthorization := SelectProxyAuthorization;
   Http.OnProxyAuthorization := ProxyAuthorization;

   Http.Get('https://<url>');
end;

procedure ProxyAuthorization(Sender: TObject;
   Authentication: TIdAuthentication; var Handled: Boolean);
begin
   Authentication.Username := <username>;
   Authentication.Password := <password>;
   Handled := True;
end;

procedure SelectProxyAuthorization(Sender: TObject;
   var AuthenticationClass: TIdAuthenticationClass;
   AuthInfo: TIdHeaderList);
begin
   AuthenticationClass := TIdDigestAuthentication;
end;

When Get() is called, events SelectProxyAuthorization and
ProxyAuthorization are fired but after that the application waits and
then a 'read timeout' exception is raised. I used the same code with
'Basic' authorisation successfully (except then TIdBasicAuthentication
class was returned for AuthenticationClass).

Any ideas what I'm doing wrong?

Any help greatly apreciated.

Regards,

Kees Vermeulen

Replies:

www.cryer.info
Managed Newsgroup Archive