HTTP Server Application question lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- xinyiman · 2018-05-25 10:23 Hi guys, I made a small HTTP Server Application. But I would like to understand how to use the https protocol. The final project must run on a linux server. Thank you, attached my sample program to change to use https ---------------------------------------------------------------------- Leledumbo · 2018-05-25 12:13 Currently you must use a reverse proxy that already implements HTTPS. Server side of fcl-web doesn't support it yet. ---------------------------------------------------------------------- xinyiman · 2018-05-25 12:20 Other alternatives? Other components, perhaps from third parties, who have examples to do what I want? We accept advice. ---------------------------------------------------------------------- Remy Lebeau · 2018-05-30 17:21 Quote from: xinyiman on May 25, 2018, 02:20:21 pmOther alternatives? Other components, perhaps from third parties, who have examples to do what I want? We accept advice. Indy (which is available in Lazarus' OPM) is cross-platform and works on Linux.  Among many components, it has a TIdHTTPServer component which supports SSL/TLS connections for handling HTTPS. - Assign a TIdServerIOHandlerSSLBase-derived component (such as TIdServerIOHandlerSSLOpenSSL) to the TIdHTTPServer.IOHandler property, and configure it as desired (enabled SSL/TLS versions, certificates, etc). - Configure the TIdHTTPServer.Bindings property with the desired local IP:Port pair(s) that you want to accept connections on.  For HTTP, you should have a Binding on port 80, and for HTTPS, you should have a Binding on port 443.  Though you can use any port(s) you want (in which case URLs to your server will have to specify those ports explicitly). - If you use an SSL port other than 443, assign a handler to the TIdHTTPServer.OnQuerySSLPort event, and have it return True or False based on whether the provided APort parameter is a desired HTTPS port. - Assign handlers to the TIdHTTPServer.OnCommand... events as needed, such as OnCommandGet. ---------------------------------------------------------------------- Trenatos · 2018-07-20 15:15 Personally I'd just put it behind an nginx proxy, pretty standard setup for web deployments.