I’m trying to get an SSL connection working. I’ve read the various other topics here but am still not there.
My main aim is getting my JavaScript (React) client to connect using https because the app will run like this, and so my JS client has to chat with the server similarly.
I initially just let the server create a self-generating certificate, but this fails as the certificate doesn’t have the correct name in it, so I created a certificate with the right info in it, and tried to load that. Not quite sure if I’ve set the right files mind you (I’ve tried the TROHttpServer - setting the CertFile property and the TROIndyHttpServer - adding the TIdServerIOHandlerSSLOpenSSL and setting the CertFile and Keyfile properties).
I’ve now tested the MegaDemo sample, and have come across the same issue.
Using the self-generating certificate, if I use the Http Server, RO Socket with SSL and connect to the server with a browser to http://localhost:8099/bin (which works fine none SSL), then I get :
This page isn’t working
**localhost** didn’t send any data.
ERR_EMPTY_RESPONSE
When I try with the Indy Server (note I’ve dropped a TIdServerIOHandlerSSLOpenSSL on the form and changed the code in bActivateHTTPClick to this:
if RbIndyHttp.Checked then begin
HTTPZeroConfRegistration.Server := ROIndyHTTPServer;
ROJavaScriptHttpDispatcher.Server := ROIndyHTTPServer;
ROIndyHTTPServer.Port := seHTTPPort.Value;
ROIndyHTTPServer.BindV4 := True;
ROIndyHTTPServer.BindV6 := True;
if cbSSL.Checked then
ROIndyHTTPServer.IndyServer.IOHandler:=IdServerIOHandlerSSLOpenSSL1
else ROIndyHTTPServer.IndyServer.IOHandler:=nil;
ROIndyHTTPServer.Active := True;
end
)
when I connect with the browser, the server stops with this error:
Project MegaDemoServer.exe raised exception class EIdOSSLUnderlyingCryptoError with message 'Error accepting connection with SSL.
error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request'.
I get the same response at the browser.
If I now add my certificate to the ROHttp Server (I have a certificate.pem file - I’ve also tried a file with the combined certificate and private key files as per SSL/TLS (Delphi)), I get the following error when trying to activate it:
Project MegaDemoServer.exe raised exception class EROOpenSSLApi with message 'error:0A080009:SSL routines::PEM lib
Any suggestions welcome!
Using lastest version, 10.0.0.1555.