2

I'm trying to use REST. So I'm using the TIdHTTP component. But it says 'Could not load SSL Library'. What am I missing? My knowledge about SSL is zero.

I'm using Delphi 2007, Indy 10.1.5, and Windows 32-bit.

I put libeay32.dll and ssleay32.dll in my EXE directory (I found these DLL files at https://indy.fulgan.com/SSL/, file openssl-1.0.2t-i386-win32.rar).

type
  TForm1 = class(TForm)
  IdSSLIOHandlerSocketOpenSSL1: TIdSSLIOHandlerSocketOpenSSL;
  ...

procedure TForm1.btn_ReqCheckServerClick(Sender: TObject);
var
  s: string;
  lHTTP: TIdHTTP;
const
  URL_CHECK_SERVER = 'http://example';  // some URL site to ping
begin
  lHTTP := TIdHTTP.Create(nil);
  try
    lHTTP.IOHandler:=IdSSLIOHandlerSocketOpenSSL1;
    IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method:=sslvTLSv1;
    lHTTP.ProtocolVersion:=pv1_1;
    lHTTP.Request.ContentType := 'application/json';
    lHTTP.HandleRedirects := True;
    s := lHTTP.Get(URL_CHECK_SERVER);
    ShowMessage(s);
  finally
    lHTTP.Free;
  end;
end;
Gabriel
  • 20,797
  • 27
  • 159
  • 293
FZS
  • 160
  • 1
  • 2
  • 14

2 Answers2

2

Does anybody know where the latest version of Indy can be download? At https://www.indyproject.org, many links are broken.

Indy's SVN repository is being retired. Indy's GitHub repository at https://github.com/IndySockets/Indy is now the active repository moving forward. Fulgan has recently turned off its sync between Indy's SVN and GitHub repositories.

Fulgan's nightly zip file at https://indy.fulgan.com/ZIP/ is no longer the latest dev snapshot of Indy (there have been a few check-ins to GitHub since the last time Fulgan pulled its snapshot from SVN). It has become redundant since users can pull zip files of Indy's source code from GitHub instead.

Indy will also soon be making a new GitHub repository for its OpenSSL lib binaries, which will be the final nail in the coffin for Indy's Fulgan mirror.

Indy's website at https://www.indyproject.org has not been updated yet to reflect this new information. Though there is a link to the GitHub repository in the download section for the dev snapshot.

You can go to the GitHub repository and grab the /Lib folder. You only need the /Lib/Core, /Lib/Protocols and /Lib/System folders at a minimum to compile Indy.

I'm trying to use REST. So I'm using the TIdHTTP component. But it is not working. It says 'Could not load SSL Library'. I already read about this error from this forum, but still it is not working.

You can use Indy's WhichFailedToLoad() function in the IdSSLOpenSSLHeaders unit to find out why Indy could not load OpenSSL. Either the DLLs could not be loaded in memory, or the DLLs are missing exports that Indy requires.

Note, though, that 10.1.5 is an extremely old version of Indy, the latest version is 10.6.2. It is likely that 10.1.5 simply can't handle changes made to OpenSSL over the years since 10.1.5 was released. For instance, the removal of support for SSLv2 and SSLv3 is a likely culprit for an old version of Indy failing to load newer OpenSSL DLLs.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • Ok, upgrade to Indy 10.6.2.5516. Thank you, Remy. Using libeay32.dll and ssleay32.dll with modified date 11/13/2015 7:55 AM both. – FZS Dec 19 '19 at 02:39
0

I am using :

  • Delphi 2007 (package version 110).
  • Windows 7.

Upgrade old Indy version ( Indy 10.1.5 ) to relative new Indy version ( Indy 10.6.2.5516 ).

Steps that I tried :

  • Component | Install packages... | Design Packages
  • point to Indy 10 Core Design Time, then click Remove button
  • point to Indy 10 Protocols Design Time, then click Remove button
  • delete all library path that refer to old Indy version
    ( Tool | Options | Environment Options | Delphi Options | Library - Win32 )
  • delete all IndySystem110.* IndyCore110.* and IndyProtocols110.* on PC.
  • open the individual DPK files in the IDE and I compile them, in the following order :
    • IndySystem110.dpk ( in Lib\System ) compile only.
    • IndyCore110.dpk ( in Lib\Core ) compile only.
    • IndyProtocols110.dpk ( in Lib\Protocols ) compile only.
    • dclIndyCore110.dpk ( in Lib\Core ), compile then install.
    • dclIndyProtocols110.dpk ( in Lib\Protocols ), compile then install.
  • Add Lib\System, Lib\Core, and Lib\Protocols to Delphi library path. ( Tool | Options | Environment Options | Delphi Options | Library - Win32 )

then I put libeay32.dll and ssleay32.dll with modified date 11/13/2015 7:55 AM both in my executable file folder location. It works !

FZS
  • 160
  • 1
  • 2
  • 14
  • 1
    "*Indy 10.6.2.5516*" - why not the latest? The last version on Fulgan is 10.6.2.5520, and what is on GitHub is newer than that. "*libeay32.dll and ssleay32.dll with modified date 11/13/2015 7:55 AM both*" - why such old DLLs? Use up-to-date DLLs instead. OpenSSL 1.0.2t (Sept 2019) should work fine with Indy. And OpenSSL 1.0.2u is being released in 2 days. – Remy Lebeau Dec 19 '19 at 03:58
  • I already tried using 5520 version, but while install the dclIndyCore110.dpk, it raised an error. It said "Unable to install package C:\blablabla\RAD Studio\5.0\Bpl\dclIndyCore110.bpl" – FZS Dec 19 '19 at 13:01
  • did you try the newer version from GitHub? – Remy Lebeau Dec 19 '19 at 15:14