You are not logged in.
Hello,
could some please explain to me, how to start an HTTPS server under Linux. I didn't use try except blocks here, just to keep the pasted code smalI:
The connection to the database works. Switching to secNone, works perfectly. When I switch to secSSL, no errors will be shown, but the HTTPS connection isn't working. No data served and i get an time out. I just found some stuff for Windows.
And yes, I got a valid Let's encrypt it cert for the server. I'm using the latested mORMot and FPC compiler.
Thanks for help.
aProps:=TSQLDBZEOSConnectionProperties.Create('zdbc:mysql://localhost','dbtest','dbuser','dbpassword');
aModel := DataModel;
VirtualTableExternalRegisterAll(aModel,aProps);
// create the main mORMot server
aRestServer := TSQLRestServerDB.Create(aModel,':memory:',false); // authentication=false
// optionally execute all SQL requests in a single thread
aRestServer.AcquireExecutionMode[execORMGet] := amBackgroundORMSharedThread;
aRestServer.AcquireExecutionMode[execORMWrite] := amBackgroundORMSharedThread;
// create tables or fields if missing
aRestServer.CreateMissingTables;
// serve aRestServer data over HTTPS
aHttpServer := TSQLHttpServer.Create(SERVER_PORT,[aRestServer],'+',HTTP_DEFAULT_MODE,32,secSSL);
aHttpServer.AccessControlAllowOrigin := '*'; // allow cross-site AJAX queries
Last edited by Tankard (2019-01-11 19:27:27)
Offline
Under Linux, TLS is not currently supported directly.
What we usually do is to setup a Nginx proxy as fronted, and bind local host as TCP or as Unix sockets.
It is very efficient, safe, and easy to setup e.g. with Let's Encrypt for automatic renewal of the certificates.
Offline