Home > database >  "Could Not Load SSL Library" error in C Builder
"Could Not Load SSL Library" error in C Builder

Time:12-08

This has already been discussed several times, but this time I'm here to ask you because it's the same case.

First of all, the point of the problem is that when using the Get() function of TIdHTTP on an HTTPS web page, a message appears that the SSL library cannot be loaded.

So I added TIdSSLIOHandlerSocketOpenSSL to TIdHTTP::IOHandler, changed the TIdHTTP::HandleRedirects property to true, moved the libeay32.dll and ssleay32.dll files to the location of the executable file, and it worked normally in C Builder Berlin.

However, in C Builder 2007, even if I set it up with the same environment and Get() code, the "Could Not Load SSL Library" error appears.

If anyone has experienced similar problems, can you please give me your solution?

CodePudding user response:

In comments, you mention that Indy's WhichFailedToLoad() function is reporting various ..._indy functions are missing in the OpenSSL DLLs. The fact that Indy is looking for those functions means you are using Indy v8 or v9, not v10. You can verify that by looking at the gsIdVersion global variable in the IdGlobal unit.

Indy v8 and v9 require custom-built OpenSSL 0.9.6 DLLs. At the time, Indy needed access to various OpenSSL internals that OpenSSL did not expose public access to yet (that was rectified in later OpenSSL versions), so Indy needed to add some custom functions to the DLLs. You can get those DLLs from the Archive folder of Indy's OpenSSL-Binaries repository.

However, Indy v8 and v9 are OLD and no longer supported. They DO NOT support OpenSSL 1.0.x and later versions. You will have to upgrade to Indy v10, which uses standard OpenSSL DLLs, and officially supports up to OpenSSL 1.0.2u (support for OpenSSL 1.1.x is work in progress, but you can try it if you need to use OpenSSL 1.1.x, such as for TLS 1.3).

  • Related