For Indy 10, you will need the 32-bit versions of ssleay32.dll and libeay32.dll from the OpenSSL 1.0.2 series. Option B: Use a Local Reverse Proxy
The "Could Not Load SSL Library" error is one of the most common and frustrating issues encountered by developers using Delphi 7 and Indy 9. It typically occurs when your application attempts to make an HTTPS request or connect to a secure server via TIdHTTP, TIdSMTP, or other SSL-enabled Indy components.
Do NOT use libssl-1_1-x64.dll or any DLL with version numbers in the filename. Indy 9 hardcodes the legacy names ( libeay32 , ssleay32 ).
Even after you load the DLLs, you might connect to https://api.modern.com and get: Delphi 7 Indy 9 Could Not Load Ssl Library
Before proceeding to a solution, performing a thorough diagnosis is crucial. This prevents wasted effort on incorrect fixes.
Install the Visual C++ 2008 SP1 Redistributable (x86). Or place msvcr90.dll alongside your EXE (check dependency with dumpbin /dependents libeay32.dll ).
You need exactly these two files:
// Assume you have a TIdSMTP (or TIdHTTP) named IdSMTP1 var IOHandler: TIdSSLIOHandlerSocketOpenSSL; begin IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil); IdSMTP1.IOHandler := IOHandler;
Ensure you extract two specific files: ssleay32.dll and libeay32.dll . 2. Place the DLLs in the Right Location
if WhichFailedToLoad <> '' then ShowMessage('Failed to load: ' + WhichFailedToLoad); Use code with caution. For Indy 10, you will need the 32-bit versions of ssleay32
If you cannot place the DLLs in your application's executable folder, you can use the IdOpenSSLSetLibPath function to specify a custom location. However, it is critical to ensure that the DLLs in the custom location are to the ones that work when placed in the EXE folder, as Windows loader and permission issues can sometimes cause otherwise functional DLLs to fail when loaded from non-standard locations.
The version of the OpenSSL DLLs present on the system is too new or too old for Indy 9 to recognize.
And if you have the political capital to migrate to Delphi 11 or 12? Do it. Your future self will thank you. Do NOT use libssl-1_1-x64
Indy 9 is strictly compatible with specific legacy versions of OpenSSL. Dropping a modern OpenSSL DLL (like version 1.1.x or 3.x) into an Indy 9 project will cause an immediate initialization failure. Step-by-Step Resolution Guide
Before diving into solutions, it is critical to understand this error happens. Indy does not natively speak SSL/TLS. Instead, it acts as a wrapper around two external dynamic link libraries (DLLs) from the OpenSSL project: