Indy 10 - IdSMTP.Connect 引发“无法加载 SSL 库." [英] Indy 10 - IdSMTP.Connect raising "Could not load SSL library."
问题描述
这是我的配置:
IdSMTP1.Host := 'smtp.gmail.com';IdSMTP1.Port := 587;IdSMTP1.UseTLS := utUseExplicitTLS;IdSMTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1;IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvTLSv1;
我已经从 here 下载了 OpenSSL,包括 libeay32.dll
和 ssleay32.dll
位于我的应用程序的同一文件夹中.
Indy 版本是:10.0.52
以下命令正在我的机器上运行:
telnet smtp.gmail.com 587
如何使用 Indy 在启用 TLS 的 SMTP 服务器(在我的情况下为 Gmail)中正确连接?
似乎 IdSSLOpenSSLHeaders.Load
找不到以下程序的地址,其中包括:
@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);
这是WhichFailedToLoad
返回的消息:
SSL_CTX_set_info_callback_indyX509_STORE_CTX_get_app_data_indyX509_get_notBefore_indyX509_get_notAfter_indySSL_SESSION_get_id_indySSL_SESSION_get_id_ctx_indySSL_CTX_get_version_indySSL_CTX_set_options_indydes_set_odd_paritydes_set_key des_ecb_encrypt
这里引用 Embarcadero 论坛中的以下讨论:
<块引用>Indy 8、9 和早期 10 版本使用定制的 OpenSSL DLL,因为OpenSSL 没有公开 Indy 需要访问的所有内容,因此 Indy 必须添加DLL 的一些自定义函数.后来的 Indy 10 版本切换到官方 OpenSSL DLL.
Indy 的自定义 OpenSSL DLL 不再分布在任何地方(我知道of),但您可以试试这个存档下载:
Fulgan 的 SSL 存档文件夹中提供了一些旧的 Indy 特定 OpenSSL DLL..p>
10.0.52 是 Indy 10 的过时版本.自该版本以来,Indy 10 发生了很多变化.你真的应该升级到 现代 Indy 10 版本,然后你就可以使用最新的 OpenSSLFulgan 的 SSL 主文件夹 中提供的 DLL.
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
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:
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.
这篇关于Indy 10 - IdSMTP.Connect 引发“无法加载 SSL 库."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!