#1 mORMot 1 » Question: How to start a HTTPS Server under Linux » 2019-01-11 18:16:41

Tankard
Replies: 1

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

Board footer

Powered by FluxBB