TIdSSLIOHandlerSocketOpenSSL

I have an  D2007  app which has worked wonderfully for years pulling data from a web site ... the procedure which pulled it is:

function GetURLAsString(const aURL: string): string;
var
  lHTTP: TIdHTTP;
begin
  lHTTP := TIdHTTP.Create;
  try
   Result := lHTTP.Get(aURL);
  finally 
   lHTTP.Free;
 end;
end;

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

Apparently something happened on the "host end" and it stopped working.

Upon reading "googled up things" I changed to 

function GetURLAsString(const aURL: string): string;
var
  lHTTP: TIdHTTP;
begin
  lHTTP := TIdHTTP.Create;
  lHTTP.HandleRedirects:=TRUE; // <--- added
  try
    Result := lHTTP.Get(aURL);
  finally
    lHTTP.Free;
  end;
end;

This changed the error message to  "IOHandler value is not valid"

So, I tried this (after googling more):

function GetURLAsString(const aURL: string): string;
var
  lHTTP: TIdHTTP;
  Id_HandlerSocket : TIdSSLIOHandlerSocketOpenSSL;
begin
  lHTTP := TIdHTTP.Create;
  lHTTP.HandleRedirects:=TRUE;
//showMessage('Indy Version: '+ lHTTP.Version);
//exit;
  try
    Result := lHTTP.Get(aURL);
  finally
    lHTTP.Free;
  end;
end;

But D2007 objected to not finding   TIdSSLIOHandlerSocketOpenSSL   ,  so I downloaded   libeay32.dll  and  ssleay32.dll and put them in the Apps Directotry (per googling more) and this did not help.

I am needing help please. 

The Indy Version I have is 10.1.5  ... 

If you are able to provide any assistance, please treat me like I a "dirt dumb", because it seems that I am on this subject.

Thank you in advance for any help,

Bob Watson

Parents
  • This changed the error message to  "IOHandler value is not valid"

    That means an HTTPS url is being requested, but you do no have a TIdSSLIOHandlerSocketBase-derived component assigned to the TIdHTTP.IOHandler property, such as TIdSSLIOHandlerSocketOpenSSL.

    So, I tried this (after googling more):

    It is not enough to just declare a variable, you have to actually create the object, and assign it to the TIdHTTP:

    function GetURLAsString(const aURL: string): string;
    var
      lHTTP: TIdHTTP;
      Id_HandlerSocket : TIdSSLIOHandlerSocketOpenSSL;
    begin
      lHTTP := TIdHTTP.Create;
      try
        lHTTP.HandleRedirects:=TRUE;
    
        Id_HandlerSocket := TIdSSLIOHandlerSocketOpenSSL.Create(lHTTP);
        // configure Id_HandlerSocket as needed...
        lHTTP.IOHandler := Id_HandlerSocket;
    
        Result := lHTTP.Get(aURL);
      finally
        lHTTP.Free;
      end;
    end;

    But D2007 objected to not finding   TIdSSLIOHandlerSocketOpenSSL

    Did you add the 'IdSSLOpenSSL' unit to your 'uses' clause?

    so I downloaded   libeay32.dll  and  ssleay32.dll and put them in the Apps Directotry (per googling more) and this did not help.

    Simply adding the DLLs to your application folder doesn't make your project magically see the identifiers at compile-time.

    The Indy Version I have is 10.1.5  ... 

    That is an extremely old version of Indy.  The current version is 10.6.2.  You really should upgrade.

Reply Children