0

Delphi with SSL is failing with the error "Could not load SSL library"

I am supporting a legacy Delphi 5 application that uses the Indy library (currently v10). to make HTTP calls to our web server. It was working fine until we switch our webserver to HTTPS. Now I get the error "Could not load SSL library".

After digging into the source of the error, it can load the openssl dlls, but it can't find three functions:

des_set_odd_parity
des_set_key
des_ecb_encrypt

I have tried using Indy 9 and Indy 10 source code. And I have tried numerous versions of the dll files. I did manage to get different functions not found when I switched to Indy 9, but nothing seems to work.

I am tempted to do something dramatic, such as have a library (written in XE) that does the HTTP work. But before I do this, I would love if there was a combo of Indy and the openssl dlls that work for Delphi 5.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 4
    You can use Indy's `WhichFailedToLoad()` function in the `IdSSLOpenSSLHeaders` unit to find out why Indy can't load the OpenSSL library. It will either be because the DLLs themselves could not be loaded into memory, or else the DLLs are missing exports that Indy requires. If it says certain functions can't be found, then you are likely using an improper version of the DLLs. In your example, you might be using DLLs that were compiled with `OPENSSL_NO_DES` defined. Try using the DLLs found at https://indy.fulgan.com/SSL/ instead, they are fully compatible with Indy. – Remy Lebeau Oct 09 '19 at 21:22
  • Thanks for the reply. After making sure I am using the libraries from the referenced location, this is now what WhichFailedToLoad() returned: ' SSL_CTX_set_info_callback_indy X509_STORE_CTX_get_app_data_indy X509_get_notBefore_indy X509_get_notAfter_indy SSL_SESSION_get_id_indy SSL_SESSION_get_id_ctx_indy SSL_CTX_get_version_indy SSL_CTX_set_options_indy des_set_odd_parity des_set_key des_ecb_encrypt' Ideas? – Joel Smallwood Oct 11 '19 at 00:25
  • You said you were using Indy 10, but only Indy 9 looks for `..._indy` functions in the OpenSSL DLLs. You can't use modern OpenSSL DLLs with Indy 9, as they don't have the `..._indy` functions in them. You need old OpenSSL 0.9.6 DLLs that were customized for Indy 9's use. Those DLLs are in Fulgan's [OpenSSL Archive folder](https://indy.fulgan.com/SSL/Archive/). Indy 10 uses the DLLs in Fulgan's [main OpenSSL folder](https://indy.fulgan.com/SSL/). – Remy Lebeau Oct 11 '19 at 00:29
  • FYI. I never actually solved the problem. Instead I wrote a dll in Tokyo that does the actual HTTPS call. – Joel Smallwood Oct 23 '19 at 15:19

0 Answers0