简体   繁体   English

Indy 10 - IdHTTP.Get 引发“无法加载 SSL 库”

[英]Indy 10 - IdHTTP.Get raising "Could not load SSL library"

In my application I am using IdHTTP.Get.在我的应用程序中,我使用的是 IdHTTP.Get。 A part of the code:部分代码:

var
  IdHTTP: TIdHTTP;
begin
  IdHTTP := TIdHTTP.Create(nil);
  Output := IdHTTP.Get(url);
  ...
  IdHTTP.Free;

Using IdHTTP.Version gives me the version: 10.6.2.5263使用 IdHTTP.Version 给我版本:10.6.2.5263

I have downloaded the OpenSSL from here , both libeay32.dll and ssleay32.dll are in the same folder of my application.我已经从这里下载了 OpenSSL,libeay32.dll 和 ssleay32.dll 都在我的应用程序的同一个文件夹中。

This problem occured since I am using a new laptop with Windows 10. I hope someone can tell me how to solve this problem!由于我使用的是装有 Windows 10 的新笔记本电脑,因此出现此问题。我希望有人能告诉我如何解决此问题!

If you need to access an https url, you must add some code, to complete the creacion of the TidHTTP component. 如果您需要访问https网址,则必须添加一些代码,以完成TidHTTP组件的创建。

Try use something like this: 尝试使用这样的东西:

// create components
HTTPs := Tidhttp.Create(nil);
IdSSL := TIdSSLIOHandlerSocket.Create(nil);
// try..finally for free
try
  // ini
  HTTPs.ReadTimeout := 30000;
  HTTPs.IOHandler := IdSSL;
  IdSSL.SSLOptions.Method := sslvTLSv1;
  IdSSL.SSLOptions.Method := sslvTLSv1;
  IdSSL.SSLOptions.Mode := sslmUnassigned;
  ...

You need to add IdSSLOpenSSL to uses clause. 您需要将IdSSLOpenSSL添加到uses子句。

Having 32 bit target platform for your application in a 64 bit system will also cause this problem.在 64 位系统中为您的应用程序提供 32 位目标平台也会导致此问题。 I don't know how to properly fix this but an easy way is to compile exe for same system your OS is.我不知道如何正确解决这个问题,但一个简单的方法是为与您的操作系统相同的系统编译 exe。

I've exactly the same problem.我有完全相同的问题。 Have you a solution to share ?你有解决方案要分享吗? My application worked with a previous version of Windows 10 and not now.我的应用程序适用于以前版本的 Windows 10 而不是现在。 But there is no problem if I compile in 32 bit.但是如果我用 32 位编译就没有问题。 The problem occurs only when compiling in 64 bit.只有在 64 位编译时才会出现此问题。

Thanks谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM