Teun
Teun

Reputation: 589

Indy 10 - IdHTTP.Get raising "Could not load SSL library"

In my application I am using IdHTTP.Get. A part of the code:

var
  IdHTTP: TIdHTTP;
begin
  IdHTTP := TIdHTTP.Create(nil);
  Output := IdHTTP.Get(url);
  ...
  IdHTTP.Free;

Using IdHTTP.Version gives me the version: 10.6.2.5263

I have downloaded the OpenSSL from here, both libeay32.dll and ssleay32.dll are in the same folder of my application.

This problem occured since I am using a new laptop with Windows 10. I hope someone can tell me how to solve this problem!

Upvotes: 7

Views: 21778

Answers (3)

franckcl
franckcl

Reputation: 1

After trying the various solutions offered here, none of them work with the latest version of Windows 10 or Windows 11. I would like to share my solution that works:

Just install the latest version of open SSL openssl-1.0.2u-x64_86-win64 which is available here.

It includes the two necessary libraries for TidHTTP libeay32.dll and ssleay32.dll in version 1.0.2.21

Upvotes: 0

Doege
Doege

Reputation: 371

Having 32 bit target platform for your application in a 64 bit system will also cause this problem. I don't know how to properly fix this but an easy way is to compile exe for same system your OS is.

Upvotes: 0

If you need to access an https url, you must add some code, to complete the creation of the TidHTTP component.

Try use something like this:

// create components
HTTPs := Tidhttp.Create(nil);
IdSSL := TIdSSLIOHandlerSocket.Create(nil);
// try..finally for free
try
  // ini
  HTTPs.ReadTimeout := 30000;
  HTTPs.IOHandler := IdSSL;
  IdSSL.SSLOptions.Method := sslvTLSv1;
  IdSSL.SSLOptions.Method := sslvTLSv1;
  IdSSL.SSLOptions.Mode := sslmUnassigned;
  ...

You need to add IdSSLOpenSSL to uses clause.

Upvotes: 2

Related Questions