德尔福XEߝ Datasnap 过滤器问题
我有一个 tcp/ip Datasnap -XE 服务器,它使用 PC1 和 Zlib 过滤器
在客户端上,这两个过滤器都是在 DataSnap TSqlConnection 中定义的
当客户端连接到服务器时,我得到一个“连接正常关闭” 错误消息
如果我只单独使用 PC1 过滤器 - 没有问题
如果我只单独使用 Zlib 过滤器 - 没有问题
关于如何让两个过滤器同时工作有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您还需要将 libeay32.dll 和 ssleay32.dll 与客户端应用程序一起部署。
引用我的 Delphi XE DataSnap 开发课件手册:
“如果您使用 TCP/IP 以及 RSA 和 PC1 过滤器部署 DataSnap 独立服务器,那么您还必须部署两个 Indy 特定的 SSL DLL:libeay32.dll 和 ssleay32.dll –或者确保它们已存在于服务器计算机上。RSA 过滤器(对 PC1 过滤器使用的密码进行加密)需要这些 DLL。如果没有这两个 DLL,任何想要连接到服务器的客户端都将获得“连接”。 Closed Graceously”消息,因为服务器无法加载两个 DLL 来启动 RSA 过滤器来加密 PC1 密钥等。
顺便说一句,任何 DataSnap 客户端都需要相同的两个 DLL,无论是否连接到 TCP/使用 RSA 和 PC1 过滤器的 IP 服务器,或者是否使用 HTTPS 连接到 ISAPI 过滤器。”
鲍勃·斯沃特·格鲁特耶斯
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
这可能是 DataSnap 中的一个错误。我有完全相同的问题,这是质量控制报告。
http://qc.embarcadero.com/wc/qcmain.aspx?d=91180
投票修复QC报告并等待Delphi-XE的更新。
编辑1
一个疯狂的想法,不要在客户端指定过滤器。
这是 Pawel Glowacki 关于传输过滤器的论文。
http://edn.embarcadero.com/article/41293
他特别提到您应该将 ZLibCompression 添加到客户端上 DataSnap 驱动程序的 Filters 属性中。
我已经测试过不这样做,而且效果很好。您必须将 DBXCompressionFilter 添加到使用子句中,否则您会收到“ZLibCompression 未注册”错误。
通过服务器上的 PC1 和 ZLibCompression,并且客户端上没有过滤器,一切都可以按预期工作。我检查了流量,它是加密和压缩的。
在来自 Embarcadero 的人确认这应该是这样之前,我在使用它之前会三思而后行。
编辑 2 这是 Bob Swart 在 Embarcadero 讨论论坛上发布的帖子,指出在服务器上添加过滤器就足够了。不是直接内河码头,但非常接近:)
https://forums.embarcadero.com/thread.jspa?threadID=48875& ;tstart=0
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
这是真实的。如果您没有在客户端上指定过滤器,则会在连接期间的初始握手协议中告知服务器的过滤器是什么,并自动添加它们。这是一种完全合理且安全的过滤器使用方式。
但请注意,反过来则不然。服务器不采用来自连接客户端的过滤器。如果客户端上有 RSA 过滤器,但服务器上没有匹配的过滤器,那么连接时会出现异常,表示服务器没有匹配的 RSA 过滤器。客户端上但服务器上没有的任何其他过滤器都将被忽略。
This is true. If you don't specify filters on the client, it is told in the initial handshake protocol during connection what the server's filters are, and it adds them automatically. This is a perfectly reasonable and safe way to use filters.
Note, however, that this isn't true in the reverse. Servers do not adopt filters from a connecting client. If you have an RSA filter on the client but not a matching one on the server, then you will get an exception on connection, saying the server has no matching RSA filter. Any other filter on the client but not on the server will be ignored.
尝试颠倒过滤器的顺序,使客户端始终与服务器相反。
例如
Try reversing the order of the filters, leaving the client always contrary server.
eg