Delphi could not load ssl library как исправить

Does anybody know where the latest version of Indy can be download? At https://www.indyproject.org, many links are broken.

Indy’s SVN repository is being retired. Indy’s GitHub repository at https://github.com/IndySockets/Indy is now the active repository moving forward. Fulgan has recently turned off its sync between Indy’s SVN and GitHub repositories.

Fulgan’s nightly zip file at https://indy.fulgan.com/ZIP/ is no longer the latest dev snapshot of Indy (there have been a few check-ins to GitHub since the last time Fulgan pulled its snapshot from SVN). It has become redundant since users can pull zip files of Indy’s source code from GitHub instead.

Indy will also soon be making a new GitHub repository for its OpenSSL lib binaries, which will be the final nail in the coffin for Indy’s Fulgan mirror.

Indy’s website at https://www.indyproject.org has not been updated yet to reflect this new information. Though there is a link to the GitHub repository in the download section for the dev snapshot.

You can go to the GitHub repository and grab the /Lib folder. You only need the /Lib/Core, /Lib/Protocols and /Lib/System folders at a minimum to compile Indy.

I’m trying to use REST. So I’m using the TIdHTTP component. But it is not working. It says ‘Could not load SSL Library’. I already read about this error from this forum, but still it is not working.

You can use Indy’s WhichFailedToLoad() function in the IdSSLOpenSSLHeaders unit to find out why Indy could not load OpenSSL. Either the DLLs could not be loaded in memory, or the DLLs are missing exports that Indy requires.

Note, though, that 10.1.5 is an extremely old version of Indy, the latest version is 10.6.2. It is likely that 10.1.5 simply can’t handle changes made to OpenSSL over the years since 10.1.5 was released. For instance, the removal of support for SSLv2 and SSLv3 is a likely culprit for an old version of Indy failing to load newer OpenSSL DLLs.

Кто знает как яндекс почту прикрутить к indy с ssl под дектоп работает, под андроид раньше работало сейчас оред что в отладке при коннекте SMTP не загружена библиотека SSL ранше использовал связку tidSMTP+tidMessage+IdSSLIOHandlerSocketOpenSSL c 465 портом

Этото код работает в десктопе на яндексе под win рабоатает со внешними библиотекеми SSL типа libeay32.dll ssleay32dll

Function TFormOFORMLENIE.mail(email:STRING):Boolean;
var email:String;
begin
  try
    Smtp.AuthType:=satDefault;
    SMTP.ReadTimeout:=10000;
    SMTP.Host := ‘smtp.yandex.ru’;
    SMTP.Port := 465;
    SMTP.Username :=login;
    SMTP.Password :=pass;

    SMTP.IOHandler:=IdSSLIOHandlerSocketOpenSSL1;
    SMTP.UseTLS:= utUseImplicitTLS;

    IdSSLIOHandlerSocketOpenSSL1.Destination := SMTP.Host+’:’+IntToStr(SMTP.Port);
    IdSSLIOHandlerSocketOpenSSL1.Host := SMTP.Host;
    IdSSLIOHandlerSocketOpenSSL1.Port := SMTP.Port;
    IdSSLIOHandlerSocketOpenSSL1.DefaultPort := 0;
    IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method:=sslvTLSv1;
    IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Mode := sslmUnassigned;
    MailMessage.From.Name := ‘Тест’;
    MailMessage.Subject := ‘Тест: ‘+FormatDateTime(‘dd.mm.yy-hh:nn’,Now) ;

    MailMessage.From.Address :=’bossalex@ya.ru’;
    MailMessage.Recipients.EMailAddresses := email;
    MailMessage.Body.Text := MemoTXT.Text;
  try
      try
        SMTP.Connect;// орет нет библиотеки SSL – под win рабоатает со внешними библиотекеми SSL типа libeay32.dll ssleay32dll только не FMX на VCL к яндексу коннектися и отправляет письма,

// есть еще libgcc_s_dw2-1.dll libwinpthread-1.dll msvcr100.dll правда не помню тоже какието библиотеки забыл для чего, надо в инете поковырять
        sleep(200);
        Application.ProcessMessages;
        SMTP.Send(MailMessage);
        ShowMessage(‘Письмо отправлено!’);
        MailMessage.MessageParts.Clear;
      except
        on e: Exception do
        begin
          sleep(200);
          ShowMessage(‘Письмо не отправлено!’);
        end;
      end;
    finally
      MailMessage.MessageParts.Clear;
      SMTP.Disconnect;
    end;
  except
  end;
end;

Some libraries, like Indy, use openssl to connect to secure servers using TLS. As some components from sgcWebSockets package are based on Indy library, make use of openssl libraries and sometimes you get an error message when you can load a library.

There are several reasons why you can’t load the openssl library.

In the following lines I will try to explain the most common ones.

Library can not be found

Yes, this is the number one reason why library can not be loaded. Usually if openssl libraries are in the same folder that your main application, openssl can be loaded in your app. You can try to update your global path where your openssl libraries are if this is not the same folder than your application.

So, every time you get this error, first check if your openssl libraries exists and are in the correct folder. 

Library is old

OpenSSL libraries are updated quite often and sometimes you don’t have the latest openssl libraries or are not compatible with your application.

Check if you have latest openssl libraries because if some function needed by your app are not included in your openssl library, this can be a reason why can not be loaded. 

VC++ runtime package is not installed 

Yes, another reason, why openssl library can not be loaded, in windows environments, is because vc++ runtime packages are not installed in your machine. If you are not sure if have been installed, first install runtime package and try again. 

Delphi XE7 is using Indy version 10.6.0.5169 and if you want to use SSL components you now need to install OpenSSL. I’m using IdSSLIOHandlerSocketOpenSSL1 component for my FlickrPhotoStats application (you can read more about it here : Delphi REST client to retrieve flickr statistics ) that uses REST technology to retrieve flickr stats using the available API.

My tool used to work under Delphi XE6 without problems and after my upgrade to Delphi XE7 I can see that when it tries to use the IdHTTP component the following exception is thrown: “Cannot load SSL library“. Basically

the error is raised because now you need to install

 (*see comments below) you need to update OpenSSL as Delphi XE7 has a dependency with the latest library. Update it locally in your machine in order to use IndySSL components. At runtime, Indy loads two libraries: libeay32.dll and ssleay32.dll (these libraries are not distributed with Indy due to some restrictions exporting SSL technology). 

The easiest solution to fix this issue, is to download the following library:

  • Win32 OpenSSL v1.0.1i.
  • Win32 OpenSSL v1.0.li light. (Light version).

Updated location -> IndySockets/OpenSSL-Binaries: An archive of OpenSSL binaries that are typically used with Indy (github.com)

This library among others can be found here: Win32OpenSSL.

NOTE: this solution is only applicable on Windows. I have only tested it under Windows 7 64 bits and it works fine.

Once the setup has been launched, select the following option:

After the libraries have been installed, the application will work without problems. DLLs can be found in the OpenSSL-Win32 directory also. With the selected option (Windows system directory) the libraries will be installed at C:windowsSysWOW64 folder.

Update: KM mentioned that it’s better to distribute the libraries with the app instead of installing the libraries under windows directory.

Update: Nicholas Ring has provided a very useful link for OpenDec (Home of OpenSSL DLLs & the Delphi Encryption Compendium), DLLs can be found here also:

  • OpenDec. 

If you are interested in my application, this can be found here:

Source code and binaries can be found here:

  • https://github.com/JordiCorbilla/FlickrPhotoStats (Source code)
  • FlickrPhotoStats(x86) v3.0. (binaries)
  • FlickrPhotoStats(x64) v3.0. (binaries)

Screenshots:

Сообщество Программистов

Загрузка…

Добавить комментарий