Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi XE2 DataSnap - 'Connection Closed Gracefully' When Using REST Over HTTPS

I'm trying to connect to my DataSnap service using REST over HTTPS, both from my Delphi Win32 app and an Android app. In my Delphi client I get the message 'Connection Closed Gracefully', and my Android app fails with 'No peer certificate'. I'm guessing I need something installed on the client end. I've installed the 2 OpenSSL DLLs 'libeay32.dll' and 'ssleay32.dll' in the EXE folder on the Win32 app as recommended by other posts but this hasn't resolved the problem.

One thing to note is I can successfully connect over HTTPS from the Win32 app using DBXpress - using the TSQLConnection component. It just doesn't work using TDSRESTConnection. With Android I only have the option of REST.

Hopefully I'm just missing something simple?

like image 468
Jonathan Wareham Avatar asked Nov 05 '22 07:11

Jonathan Wareham


1 Answers

Are you sure that both the DataSnap Server and the Client have access to the libeay32.dll and ssleay32.dll files and can hence load them? The error message you get is typically the case when either side cannot find/load these SSL DLLs...

(skipe the server part if you're using an ISAPI DLL, in which case IIS takes care of SSL).

like image 126
Bob Swart Avatar answered Nov 07 '22 21:11

Bob Swart