Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi XE – Datasnap Filter problems

I have a tcp/ip Datasnap -XE Server that uses a PC1 and Zlib filter

On the Client both of these filters are defined in DataSnap TSqlConnection

When the client connects to the server I get a "Connection Closed Gracefully” error message

If I only use the PC1 filter on its own - there is no problem

If I only use the Zlib filter on its own - there is no problem

Any Ideas on how I can get both filters working at the same time?

like image 631
Charles Faiga Avatar asked Jun 13 '26 18:06

Charles Faiga


2 Answers

You need to deploy the libeay32.dll and ssleay32.dll with your client application as well.

A quote from my Delphi XE DataSnap Development courseware manual:

"If you deploy the DataSnap standalone server, using TCP/IP and the RSA and PC1 filters, then you must also deploy two Indy specific SSL DLLs: libeay32.dll and ssleay32.dll – or make sure they already exist at the server machine. These DLLs are needed for the RSA filter (which encrypts the password used by the PC1 filter). Without these two DLLs, any client who wants to connect to the server will get an “Connection Closed Gracefully” message, because the server was unable to load the two DLLs to start the RSA filter to encrypt the PC1 keys, etc.

By the way, the same two DLLs will be required for any DataSnap client, whether connected to the TCP/IP server using the RSA and PC1 filters, or whether connected to the ISAPI filter using HTTPS."

Groetjes, Bob Swart

like image 147
Bob Swart Avatar answered Jun 17 '26 22:06

Bob Swart


It is probably a bug in DataSnap. I have exactly the same problem and here is the QC report. http://qc.embarcadero.com/wc/qcmain.aspx?d=91180

Vote on QC report to be fixed and wait for an update of Delphi-XE.

Edit 1 A crazy idea, don't specify filters on the client.

Here is a paper from Pawel Glowacki on Transport Filters. http://edn.embarcadero.com/article/41293 He specifically mentions that you should add ZLibCompression to the Filters property of the DataSnap driver on the client.

I have tested not to do so and it works just fine. You do have to add DBXCompressionFilter to the uses clause otherwise you get "ZLibCompression is not registered" error.

With PC1 and ZLibCompression on the server and no filter on the client everything seams to work as expected. I have checked the traffic and it is encrypted and compressed.

Until someone from Embarcadero confirms that this is the way it should be I would think twice before I used it.

Edit 2 Here is a post on Embarcadero Discussion Forums by Bob Swart saying that it is enough to add the filters on the server. Not Embarcadero directly but pretty close :) https://forums.embarcadero.com/thread.jspa?threadID=48875&tstart=0

like image 44
Mikael Eriksson Avatar answered Jun 17 '26 21:06

Mikael Eriksson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!