"Cannot load SSL Library" using Delphi XE7

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:
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:\windows\SysWOW64 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:



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

Source code and binaries can be found here:

Screenshots:



Comments

  1. I get my OpenSSL DLLs from http://opendec.wordpress.com/, which is done by a person that also works on Indy

    ReplyDelete
    Replies
    1. Hi Nicholas,

      Thanks for the link! I will update my post.

      Jordi

      Delete
  2. The OpenSSL DLLs are also available at http://indy.fulgan.com/SSL/ - this is next to the location for zipped nightly snapshot http://indy.fulgan.com/ZIP (which is linked from http://www.indyproject.org/Sockets/Download/DevSnapshot.aspx)

    ReplyDelete
    Replies
    1. Hi Mike,

      Thanks for your input, I will add it to the post also.

      Jordi

      Delete
  3. The OpenSSL DLLs are also available at http://indy.fulgan.com/SSL/ - this is next to the location for zipped nightly snapshot http://indy.fulgan.com/ZIP (which is linked from http://www.indyproject.org/Sockets/Download/DevSnapshot.aspx)

    ReplyDelete
  4. 1) Don't install in the Windows system directory. That is the OS private directory, don't mess there. Copy OpenSSL dlls into your application directory.
    2) Keep them updated - OpenSSL is under great scrutiny now and there will be a lot of fixes.
    3) Shining LIght OpenSSL distribution requires the Visual C++ runtime. Don't install the full OpenSSL SDK on machines that doesn't require it (use the Light version, if you choose this distribution).
    4) Indy project mirrors OpenSSL builds at http://indy.fulgan.com/SSL/. These doesn't require the runtime, and you just really need the two DLLs.

    ReplyDelete
    Replies
    1. Hi KM,

      I will do what you mention then. I can use the DLLs and use the light version of it.

      Jordi

      Delete
  5. Hi Remy,

    Thanks for your insights and useful comments. That's why posts like this are very useful as we get the correct response from the community. I will reflect the changes in the post with you info.

    Many thanks,
    Jordi

    ReplyDelete
  6. Hi,
    I have downloaded from http://indy.fulgan.com/SSL/ and used OpenSSL dlls into my application directory. My system is windows 8.1 and using XE7. But SSL error is coming as "Could not load SSL library".

    ReplyDelete
    Replies
    1. Hi Santosh,

      Are you sure those dlls are placed where your executable is? and that the version matches with your executable (32 or 64 bits)?

      Cheers,
      Jordi

      Delete
    2. I am having the same problem, I m using Delphi 2006 with Indy 10.6. Downloaded latest openssl-1.1.0e and put the 2 dll in the same folder with the application exe file. Still having Could not load SSL library error.

      Delete
  7. Having these issues as well writing an SendSMS application using TIdHTTP or TRESTClient with XE7 I did search for the dlls and found both versions (32Bit and 64 Bit) on my computer:

    The 32 Bit version is installed in Delphi XE7 subversion client's bin folder:
    C:\Program Files (x86)\Embarcadero\Studio\15.0\bin\subversion (named libeay32.dll and ssleay32.dll as expected)

    The 64 Bit version was found in the VMware Tools folder:
    C:\Program Files\VMware\VMware Tools (named libeay32.dll and ssleay32.dll not 64!)

    Copying libeay32.dll and ssleay32.dll to the program start folder of my application solved the issue application

    ReplyDelete

Post a Comment

Popular Posts