Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
libeay32.dll not found
#1
Hallo,

I try to deploy a software for a ftp-server access. I am using the c++ builder 10.2.3 with indy 10. If I try to connect to the server I get the error message "ssl negotiation failed".
The function "WhichFailedToLoad()" gives back "libeay32.dll not found". A copy of the dll to the application folder nit helps.
What can I do, to solve this problem?
Reply
#2
(01-15-2021, 01:36 PM)Matti1104 Wrote: I try to deploy a software for a ftp-server access. I am using the c++ builder 10.2.3 with indy 10.

Are you using the version of Indy that shipped pre-installed in the IDE, or are you using a different version you installed manually?

(01-15-2021, 01:36 PM)Matti1104 Wrote: If I try to connect to the server I get the error message "ssl negotiation failed".
The function "WhichFailedToLoad()" gives back "libeay32.dll not found".

That is not what WhichFailedToLoad() would say.  It would be more like "Failed to load libeay32.dll" instead.  A failure to load, and a file not found, are potentially two very different error conditions. A load could fail for any number of reasons, including the file not being found.

(01-15-2021, 01:36 PM)Matti1104 Wrote: A copy of the dll to the application folder nit helps.

Do you also have ssleay32.dll in the same folder as libeay32.dll?  Are both DLLs using the same bitness (32bit vs 64bit) as your app?  Do both DLLs belong to the same OpenSSL version?  Are the DLLs for OpenSSL 1.0.2 or earlier, or for OpenSSL 1.1+?  The TIdSSLIOHandlerSocketOpenSSL component does not support OpenSSL 1.1+, you would have to use this SSLIOHandler instead, for the time being.

Reply
#3
(01-15-2021, 07:24 PM)rlebeau Wrote:
(01-15-2021, 01:36 PM)Matti1104 Wrote: I try to deploy a software for a ftp-server access. I am using the c++ builder 10.2.3 with indy 10.

Are you using the version of Indy that shipped pre-installed in the IDE, or are you using a different version you installed manually?

(01-15-2021, 01:36 PM)Matti1104 Wrote: If I try to connect to the server I get the error message "ssl negotiation failed".
The function "WhichFailedToLoad()" gives back "libeay32.dll not found".

That is not what WhichFailedToLoad() would say.  It would be more like "Failed to load libeay32.dll" instead.  A failure to load, and a file not found, are potentially two very different error conditions.  A load could fail for any number of reasons.

(01-15-2021, 01:36 PM)Matti1104 Wrote: A copy of the dll to the application folder nit helps.

Do you also have ssleay32.dll in the same folder as libeay32.dll?  Are both DLLs using the same bitness (32bit vs 64bit) as your app?  Do both DLLs belong to the same OpenSSL version?  Are the DLLs for OpenSSL 1.0.2 or earlier, or for OpenSSL 1.1+?  The TIdSSLIOHandlerSocketOpenSSL component does not support OpenSSL 1.1+, you would have to use this SSLIOHandler instead, for the time being.

Copy the both dll's to an extra Folder to your  App-Directory to get sure that the App load the right Version that it needs
like /SSL/32 and /SSL/64 . . .

Place your needed ssleay.dll and libeay.dll Version into those predefined Places and let your Software load it from there.

C++Builder Example Code:

Code:
UnicodeString Path = GetCurrentDir();

#ifdef __WIN32__
  IdOpenSSLSetLibPath(Path+"\\SSL\\32\\");
#endif

#ifdef _WIN64
  IdOpenSSLSetLibPath(Path+"\\SSL\\64\\");
#endif

latest Version what i found is  1.0.2u   afaik. . .
Reply
#4
(01-16-2021, 06:16 AM)fearcry Wrote:
Code:
UnicodeString Path = GetCurrentDir();

Don’t use GetCurrentDir() for this. You can’t guarantee the calling process’ working directory is what you are expecting at any given moment. To get the folder path where your app is running from, use ExtractFilePath(Application->ExeName) or ExtractFilePath(ParamStr(0)) instead.

Reply
#5
(01-16-2021, 09:13 AM)rlebeau Wrote:
(01-16-2021, 06:16 AM)fearcry Wrote:
Code:
UnicodeString Path = GetCurrentDir();

Don’t use GetCurrentDir() for this. You can’t guarantee the calling process’ working directory is what you are expecting at any given moment. To get the folder path where your app is running from, use ExtractFilePath(Application->ExeName) or ExtractFilePath(ParamStr(0)) instead.

Thank you very much for your response.
I have solved the problem. I am used the wrong dll-versions.
With version 0.9.8.15 of the libeay32.dll and the ssleay32.dll it works.
Reply
#6
(01-18-2021, 07:16 AM)Matti1104 Wrote: I have solved the problem. I am used the wrong dll-versions.
With version 0.9.8.15 of the libeay32.dll and the ssleay32.dll it works.

That is an extremely old version of OpenSSL. The highest version that the TIdSSLIOHandlerSocketOpenSSL component supports is 1.0.2u (1.0.2.21), which is the last version of the 1.0.2 line before it reached EOL at the end of 2020. For OpenSSL 1.1.0 and higher, you need to use this SSLIOHandler instead.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)