Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indy 10 - IdSMTP.Connect raising "Could not load SSL library."

Here is my configuration:

IdSMTP1.Host := 'smtp.gmail.com';
IdSMTP1.Port := 587;
IdSMTP1.UseTLS := utUseExplicitTLS;
IdSMTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1;
IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvTLSv1;

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

The Indy version is: 10.0.52

The following command is working on my machine:

telnet smtp.gmail.com 587

How to properly connect in a TLS enable SMTP server, in my case Gmail, using Indy?

It seems like IdSSLOpenSSLHeaders.Load could not find the address to the following procedures, among others:

  @IdSslSessionGetId := LoadIndyFunction(fn_SSL_SESSION_get_id);
  @IdSslSessionGetIdCtx := LoadIndyFunction(fn_SSL_SESSION_get_id_ctx);
  @IdSslCtxGetVersion := LoadIndyFunction(fn_SSL_CTX_get_version);
  @IdSslCtxSetOptions := LoadIndyFunction(fn_SSL_CTX_set_options);

  @iddes_set_odd_parity := LoadFunctionCLib(fn_des_set_odd_parity);
  @iddes_set_key := LoadFunctionCLib(fn_des_set_key);
  @iddes_ecb_encrypt := LoadFunctionCLib(fn_des_ecb_encrypt);

This is the message returned from WhichFailedToLoad:

 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
like image 308
EProgrammerNotFound Avatar asked Feb 26 '14 18:02

EProgrammerNotFound


1 Answers

Here is a quote from the following discussion in the Embarcadero forums:

OpenSSL Version to work with indy 10.0.52

Indy 8, 9, and early 10 versions used custom-built OpenSSL DLLs because OpenSSL did not expose everything Indy needed access to, so Indy had to add a few custom functions to the DLLs. Later Indy 10 versions switched to the official OpenSSL DLLs.

Indy's custom OpenSSL DLLs are no longer distributed anywhere (that I know of), but you can try this archived download:

http://web.archive.org/web/20071022121646/http://www.intelicom.si/www.nsf/2434100e396ad3f3c125705100369374/d6b8e150fe453facc1257082006fc8b9/$FILE/indy_openssl096g.zip

Some old Indy-specific OpenSSL DLLs are available in Fulgan's SSL Archive folder.

10.0.52 is an outdated release of Indy 10. There have been a lot of changes to Indy 10 since that release. You really should upgrade to a modern Indy 10 release, and then you can use the latest OpenSSL DLLs that are available in Fulgan's SSL main folder.

like image 56
Remy Lebeau Avatar answered Sep 30 '22 19:09

Remy Lebeau