Reputation: 21
I have a DataSnap server running in a Docker container (ubuntu 18.04) and when trying to connect to it, it returns "Connection Closed Gracefully." The encryption filters are turned on, and I know this message typically means I have forgotten to include the OpenSSL libraries where the application can find it. I feel fairly confident the missing OpenSSL libraries is the issue because I compiled the DataSnap server without encryption filters and the connection worked.
This is not our first DataSnap server application, but the first time running one in a Linux environment. We are used to including libeay32.dll and ssleay32.dll in the same folder as our Windows applications, but my attempts at providing similar library files in this Linux / ubuntu environment have not worked.
Looking at this post (http://docwiki.embarcadero.com/RADStudio/Rio/en/OpenSSL) and looking at the Indy10 source code (IdSSLOpenSSLHeaders.pas) it seems the required library files are libssl.so and libcrypto.so. There is also a SSLDLLVers constant array of strings that is used to attempt to load different versions of the library files.
I think OpenSSL is already in the ubuntu 18.04, but I also ran an "apt-get -y install openssl" command to make sure. I have copied the resulting files (libcrypto.so.1.1 and libssl.so.1.1) from the /usr/lib/x86_64-linux-gnu folder to the same folder as the DataSnap server and to the /usr/lib folder. In each case, I renamed the file with just the .so extension. I have verified the copy actually worked, but no luck.
It feels like there are two possible hurdles -- either the library files are not in the right place and are not being loaded, or there is a library version issue. The Indy10 source code is looking for version extensions up to .1.0.2 and this is .1.1. I am cheating a bit by removing that full extension when I copy the file to the application folder and just leaving the .so extension, but we have not had any issues with our Windows DataSnap servers running the latest OpenSSL libraries so I'm hoping it's not a version compatibility issue.
I would appreciate any help or suggestions. If this draws a personal response from Remy Lebeau it will be an early holiday present!
Upvotes: 0
Views: 573
Reputation: 371
I had similar issues, I discovered my libeay32.dll and ssleay32.dll versions was 1.0.2.23, but only worked with 1.0.2.21. I think because support of Indy until 1.0.2.21 at the moment but I am not sure about that.
Upvotes: 0
Reputation: 21
I think the issue was trying to use Ubuntu 18.04. I was also having issues getting the MS-SQL drivers to load in 18.04, so I fell back to using the 16.04 image instead. That corrected the OpenSSL driver issue since the latest libraries for that image are 1.0.2 and the MS-SQL drivers work then, too.
Upvotes: 1