Indy“无法加载SSL库”德尔福XE2 IW14 [英] Indy "Could not load SSL library" Delphi XE2 IW14

查看:340
本文介绍了Indy“无法加载SSL库”德尔福XE2 IW14的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个问题已经被问过了,但没有一个答案似乎适合这种情况。

I know this question has been asked before but none of the answers seem to be appropriate for this situation.

我正在使用带有SSL处理程序的TIdHttp组件。我的代码如下:

I'm using a TIdHttp component with an SSL handler. My code is as follows:

  idHTTPClient := TIdHTTP.Create(nil);
  ioHnd := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
  ioHnd.DefaultPort := iSSL_PORT;
  ioHnd.SSLOptions.Mode := sslmClient;
  idHTTPClient.IOHandler := ioHnd;
  idHTTPClient.Request.AcceptEncoding := 'gzip,deflate,identity';
  idHTTPClient.Request.BasicAuthentication := False;

  try
    idHTTPClient.Post(FFQDN, stmRequest, stmResponse);
  except
    on E:Exception do
    begin
      if IdSSLOpenSSLHeaders.WhichFailedToLoad <> '' then
      begin
        AddMsg('Failed to load file ' + IdSSLOpenSSLHeaders.WhichFailedToLoad + '. ' + E.Message);
      end;
    end;
  end;

机器上有三个版本的ssleay32和libeay32.dll文件。一组与我的可执行文件(V1.0.0.5)在同一个文件夹中。一组在Apache bin文件夹(V0.9.8.20)中,一组在C:\Windows\SysWOW64(没有版本,但是日期为2003年)。

There are three versions of the ssleay32 and libeay32.dll files on the machine. One set is in the same folder as my executable (V1.0.0.5). One set is in the Apache bin folder (V0.9.8.20) and one set is in C:\Windows\SysWOW64 (no version but dated 2003).

当应用程序启动它运行正常。但是几天之后,邮件通知开始失败,并显示无法加载SSL库。无法加载的文件是:

When the app starts it runs fine. But after a few days the Post call starts to fail with "Could not load SSL library". The files which fail to load are:

SSL_SESSION_get_id,SSL_COMP_get_compression_methods

SSL_SESSION_get_id,SSL_COMP_get_compression_methods

一旦这个问题开始发生,直到应用程序重新启动。然后再工作好几天。

Once this problem starts to happen it won't go away until the app is restarted. Then it works fine again for another few days.

在我看来,由于某种原因,dll的加载会在几天后改变。这样会发生什么,我可以做些什么来确保每次都加载正确的文件?

It would seem to me that for some reason the dlls being loaded change after a few days. How could this happen and what could I do to ensure the correct files are loaded every time?

推荐答案

理想情况下,删除所有其他您的机器上的OpenSSL DLL版本,以确保您的应用程序始终找到正确的DLL。它的多个版本和进程(Apache)加载导致冲突的这些不同版本。

Ideally, delete all the other versions of OpenSSL DLLs on your machine to ensure that your app always finds the correct DLL. Its the multiple versions and processes (Apache) loading these different versions that is causing the conflict.

这篇关于Indy“无法加载SSL库”德尔福XE2 IW14的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆