You are not logged in.
Pages: 1
Hi everyone,
I am maybe starting a dumb question, it's possible to have a TSQLHTTPServer running with useBidirSocket and secSsl ?
I am trying to upgrade a current project to use SSL because I have a ServiceMethod which return HTML content with some javascript. In this javascript code, I call the WebAPI "navigator.share" which only works on secure (HTTPS) domains.
So I created a self-signed certificate, registered the route, everything good at this point, I can browse the document on HTTPS and execute the javascript code.
The server answer some interface services, and send push notification through websockets, but to get HTTPS working, I had to change "useBiDirSocket" to "useHttpApiRegisteringURI" to the server declaration, but after this change, I am out of WebSockets support :
fRestServer := TRestServerDB.Create(fModel, 'vremotesagas.db', true);
fHttpServer := TSQLHTTPServer.Create(PORT_NAME, [fRestServer], SERVER_URL, useHttpApiRegisteringURI, 32, secSsl); // initially set with useBidirSocket and secNone
// fHttpServer.WebSocketsEnable(fRestServer, SAGAS_TRANSMISSION_KEY);//.Settings.ClientAutoUpgrade := true;
If I set "useBiDirSocket" with "secSsl" and try to browse a document on HTTPS, i get an AV on "mormot.rest.http.server" line 1020 :
// call matching TRestServer.Uri()
call.Method := Ctxt.Method;
call.InHead := Ctxt.InHeaders;
call.InBody := Ctxt.InContent;
serv.Uri(call); <------------------- serv is nil
Offline
Pages: 1