restdelphihttpsc++builderdatasnap

How to implement HTTPS in DataSnap?


I am trying to create HTTPS secured DataSnap WebBroker application in C++ Builder, but I am unable to do so. First I created self-signed OpenSSL certificate by using the following command line:

openssl req -x509 -sha256 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365

When creating new DataSnap WebBroker (VCL) application I checked HTTPS and selected certificate file, key file and password in the wizard. I clicked "Test" inside a wizard and everything is OK (test passed). When running the application I start the server without errors, but when testing it inside a web browser I get:

URL: https://localhost:8080/

Chrome: ERR_SSL_VERSION_OR_CIPHER_MISMATCH

Firefox: SSL_ERROR_NO_CYPHER_OVERLAP

When I create a separate REST (VCL) client application and make a request I get the following error: REST request failed: Error getting Server Certificate

Why is this happening and how to fix it so that I can have a secure (HTTPS) connection? Thanks!


Solution

  • If anyone else will have a similar problem: I solved this by creating self-signed certificate in IIS and then bind it to HTTPS protocol inside IIS.