[SOLVED]FPHTTPServer with https lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- m.abudrais · 2025-11-08 10:44 I want make https server and i tried this codeCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  {$IFDEF UNIX}  cthreads,  {$ENDIF}  Classes,  SysUtils,  CustApp,  fphttpserver, opensslsockets;procedure TMyApplication.OnRequest(Sender: TObject;  var ARequest: TFPHTTPConnectionRequest; var AResponse: TFPHTTPConnectionResponse);  begin    AResponse.Content := 'hello';  end;       procedure TMyApplication.DoRun;  var    ErrorMsg: string;    HTTPServer: TFPHttpServer;  begin  HTTPServer := TFPHTTPServer.Create(nil);    try      // Configure SSL options      HTTPServer.UseSSL := True;    HTTPServer.CertificateData.PrivateKey.FileName := 'cert/privatekey.pem';      HTTPServer.CertificateData.Certificate.FileName := 'cert/certificate.pem';      // Optionally, configure allowed TLS versions, cipher suites, etc.      // HTTPServer.SSLOptions.TLSVersions := [tls1_2, tls1_3];       HTTPServer.Port := 10443; // Standard HTTPS port      HTTPServer.OnRequest := @OnRequest;      HTTPServer.Active := True;    // ... your server logic    finally      HTTPServer.Free;    end; end; the server run, but the browser(firefox) give this error: QuoteSecure Connection Failed An error occurred during a connection to 127.0.0.1:10443. PR_END_OF_FILE_ERROR Error code: PR_END_OF_FILE_ERROR     The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.     Please contact the website owners to inform them of this problem.when i remove ssl the server work correctly. i am using Lazarus 4.2, FPC 3.2.2 on linux OpenSSL 3.4.1 11 Feb 2025 (Library: OpenSSL 3.4.1 11 Feb 2025) ---------------------------------------------------------------------- paweld · 2025-11-08 11:01 FPC 3.2.2 does not support OpenSSL version 3. To make it work, you need to use at least FPC 3.2-fixes. The best solution is to install Lazarus stable with FPC 3.2-fixes using fpcupdeluxe: https://www.youtube.com/watch?v=Snf0xgdREOQ ---------------------------------------------------------------------- m.abudrais · 2025-11-08 11:08 thanks ---------------------------------------------------------------------- Warfley · 2025-11-08 12:12 The better approach is to put your own HTTP server behind a reverse proxy like nginx or apache. This has several advantages: 1. The reverse Proxy implements modern protocols and features like IPv6 support, OpenSSL 3, HTTP 2, etc. 2. A popular reverse proxy solution like nginx or apache is much better audited and supported and gets feature and security updates much faster than fpc 3. The reverse Proxy implements caching for static assets and load balancing with containerization services. So you can focus an writing a very simple HTTP handler and still get the performance benefits from a high performance and scalable system 4. the Reverse Proxy manages all your SSL certificates (like via lets encrypt) so you do not have to deal with SSL in your own server. Infact, especially because of the security concerns and the slow update cycle, it would be quite irresponsible to not use a reverse proxy if you want to make your service accessible through the internet ---------------------------------------------------------------------- m.abudrais · 2025-11-08 13:35 I like FPHTTPServer because  it is simple, and my service  will not service accessible through the internet, only in local network. I will try fpc trunk  and if did not work i may try nginx, thanks. ---------------------------------------------------------------------- m.abudrais · 2025-11-08 13:51 I installed FPC trunk using  fpcupdeluxe and it work , thank. but there is small problem with fpcupdeluxe: if you  choose to installed the stable version and tried to install the trunk, fpcupdeluxe will install the stable version again!. the solution is to delete all files in the install directory, I hop this will be fixed in the next version of fpcupdeluxe. ---------------------------------------------------------------------- DonAlfredo · 2025-11-08 15:25 Quotethis will be fixed in the next version of fpcupdeluxeNo, this will not be changed. The developers of FPC and Lazarus are against upgrading by overwriting the old version. Just install a new version in its own directory with an appropriate name that indicates a version. E.g. FPC322LAZ42 FPCTRUNKLAZTRUNK ---------------------------------------------------------------------- m.abudrais · 2025-11-08 17:18 QuoteNo, this will not be changedat least it should give a warning, so new user can understand.