Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to send SSL email but cannot load library...
#1
I am running a monitoring server on Linux (Raspberry Pi) and as part of the process an email with results is to be sent.
This is done using Indy10 and I have copied working code from another application elsewhere, which compiles fine.
However, when it runs I get an exception which logs this

Quote:ERROR: Exception during email send: Could not load SSL library.


I think that it is caused by some required package being non-available or so. Therefore I don't show any code.
If it is required I can also show the code.

But what is required on the Linux system for the SSL email to work?
On windows I think I had to get some dll to make this work...

EDIT
After searching the web I found that there might be a ssl version clash here.
Installed on my RPi3 test machine is this:

Code:
$ openssl version -v
OpenSSL 1.1.1d  10 Sep 2019

And from a reply on a similar problem made by Remy Indy10 needs an earlier version.
Since I am on an ARM Linux (Debian style) on RaspberryPi there is no binary to download I assume...
So how to handle this?

In another reply in the same thread there is a statement that FPC 3.2.0 fixes all of that, but I have FPC 3.2.0 + Lazarus 2.0.12 on my RaspberryPi and it still issues these errors!
Reply
#2
(05-05-2021, 09:58 AM)BosseB Wrote: However, when it runs I get an exception which logs this

Quote:ERROR: Exception during email send: Could not load SSL library.

What does Indy's WhichFailedToLoad() function report after that error occurs?

(05-05-2021, 09:58 AM)BosseB Wrote: But what is required on the Linux system for the SSL email to work?

OpenSSL 1.0.2 or earlier, if you are using TIdSSLIOHandlerSocketOpenSSL.

(05-05-2021, 09:58 AM)BosseB Wrote: On windows I think I had to get some dll to make this work...

Yes, ssleay32.dll and libeay32.dll. On Linux, libssl.so.<version> and libcrypto.so.<version> are used instead.

(05-05-2021, 09:58 AM)BosseB Wrote: After searching the web I found that there might be a ssl version clash here.
Installed on my RPi3 test machine is this:

Code:
$ openssl version -v
OpenSSL 1.1.1d  10 Sep 2019

TIdSSLIOHandlerSocketOpenSSL does not support OpenSSL 1.1.x. Try this experimental SSLIOHandler instead (I don't know if it has been tested on Linux, though).

(05-05-2021, 09:58 AM)BosseB Wrote: In another reply in the same thread there is a statement that FPC 3.2.0 fixes all of that, but I have FPC 3.2.0 + Lazarus 2.0.12 on my RaspberryPi and it still issues these errors!

Those fixes refer to FreePascal's own HTTP/OpenSSL implementation, not to Indy's.

Reply
#3
Regarding the experimental fix:
I am not used to GitHub and here I did only find a discussion, but there is a zipfile to download in the 3rd comment from top by JedrzejczykRobert.
Is this the modifications you refer to?
I have installed Indy using Lazarus OnLinePackageManager so it is located below the pcp directory.
Should I put the files into the Indy10 folder tree? If so where?
I don't know what to do with these files.

EDIT:
I found a dpr file inside it and it could be loaded into Lazarus but then it would not compile, complaining already over common uses clauses.
Seems like it is a dpr from some later XE version of Delphi...
Reply
#4
(05-05-2021, 07:07 PM)BosseB Wrote: Regarding the experimental fix:
I am not used to GitHub and here I did only find a discussion, but there is a zipfile to download in the 3rd comment from top by JedrzejczykRobert.
Is this the modifications you refer to?

No. The pull request I linked to has files coming from https://github.com/mezen/Indy/tree/NewOpenSSL_PR, you can download the actual files from there, just click on the green "Code" button and choose "Download ZIP", and then you can extract that over your existing Indy source files, and then recompile Indy.

Reply
#5
(05-05-2021, 10:21 PM)rlebeau Wrote:
(05-05-2021, 07:07 PM)BosseB Wrote: Regarding the experimental fix:
I am not used to GitHub and here I did only find a discussion, but there is a zipfile to download in the 3rd comment from top by JedrzejczykRobert.
Is this the modifications you refer to?

No.  The pull request I linked to has files coming from https://github.com/mezen/Indy/tree/NewOpenSSL_PR, you can download the actual files from there, just click on the green "Code" button and choose "Download ZIP", and then you can extract that over your existing Indy source files, and then recompile Indy.

I downloaded the zip now and since it contains such a lot of files I wonder if it is a complete new Indy10 installation in the zip?
There are lots of folders that do not even exist in my current installation, like:
Bubbles
Builder
icon16
icons
KB
NUnit
Other
Test

And the lib folder on my Lazarus installation seems to contain the compiled binaries (so an output folder) whereas the Lib folder inside the zip contains loads of sources, in fact the Lib folder content looks a lot like what OnLine PackageManager deposited into the onlinepackagemanager/packages/Indy10 folder...

So do I overwrite the content of the existing OLPM Indy10 checkout with the content of the zip folder Indy-NewOpenSSL_PR/Lib?
I really do not want to hose a working Indy10 by doing this erroneously.
I looked at the IdVers.inc file and it looks like the version is 10.6.2.0, same as what I have installed via OLPM.

I compared the files in the zip for folders Core, Protocols and System and the comparison turned out as shown in the attached images. A new folder OpenSSL has been added into the Protocols folder.
Would I be Ok to overwrite the three OnLinePackageManager folders with the files in the zip?

EDIT:
Notice that the comparison was done toward the 2.0.12 Lazarus/3.2.0 Fpc installation on my Winmdows laptop.
I don't have such comparison tools like WinDiff on Linux...


Attached Files Thumbnail(s)
               
Reply
#6
(05-06-2021, 09:04 AM)BosseB Wrote: I downloaded the zip now and since it contains such a lot of files I wonder if it is a complete new Indy10 installation in the zip?

That is how GitHub works. It is a clone of Indy's whole repo, with modifications applied.

(05-06-2021, 09:04 AM)BosseB Wrote: There are lots of folders that do not even exist in my current installation, like:
Bubbles
Builder
icon16
icons
KB
NUnit
Other
Test

You can ignore all of that. Indy's source files are in the Lib folder, that is all you need.

(05-06-2021, 09:04 AM)BosseB Wrote: And the lib folder on my Lazarus installation seems to contain the compiled binaries (so an output folder) whereas the Lib folder inside the zip contains loads of sources, in fact the Lib folder content looks a lot like what OnLine PackageManager deposited into the onlinepackagemanager/packages/Indy10 folder...

So do I overwrite the content of the existing OLPM Indy10 checkout with the content of the zip folder Indy-NewOpenSSL_PR/Lib?

Probably, but I have no idea how OPM works and whether it will try to overwrite those modified files with what is in Indy's main repo.

(05-06-2021, 09:04 AM)BosseB Wrote: I looked at the IdVers.inc file and it looks like the version is 10.6.2.0, same as what I have installed via OLPM.

IdVers.inc is not up-to-date: https://github.com/IndySockets/Indy/issues/292

(05-06-2021, 09:04 AM)BosseB Wrote: I compared the files in the zip for folders Core, Protocols and System and the comparison turned out as shown in the attached images. A new folder OpenSSL has been added into the Protocols folder.
Would I be Ok to overwrite the three OnLinePackageManager folders with the files in the zip?

Probably. I can't answer that for sure.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)