Forum > Networking and Web Programming

FPHTTPserver with SSL

(1/2) > >>

fpc2pas:
I think recently there is an SSL support for fphttpserver, but I think the examples provided not really working, and tried to port something similar but also fails to generate or assign a self-signed cert, any ideas or demos?

trev:
See the example simpleserver in trunk's fpcsrc/fpc-3.3.1/packages/fcl-web/examples/simpleserver

fpc2pas:

--- Quote from: trev on May 04, 2022, 12:04:10 pm ---See the example simpleserver in trunk's fpcsrc/fpc-3.3.1/packages/fcl-web/examples/simpleserver

--- End quote ---
that example is not working in Linux, also not on windows 10, there is some other examples or more docs ?

rvk:

--- Quote from: fpc2pas on May 04, 2022, 12:16:49 pm ---
--- Quote from: trev on May 04, 2022, 12:04:10 pm ---See the example simpleserver in trunk's fpcsrc/fpc-3.3.1/packages/fcl-web/examples/simpleserver

--- End quote ---
that example is not working in Linux, also not on windows 10, there is some other examples or more docs ?

--- End quote ---
So for what platform is this example working?

"Is not working" isn't really a problem description.

Here is some more information. You could try to write your own (or explain more clearly what exactly "isn't working").
https://wiki.lazarus.freepascal.org/fpWeb_Tutorial

zeljko:

--- Quote from: fpc2pas on May 04, 2022, 11:17:35 am ---I think recently there is an SSL support for fphttpserver, but I think the examples provided not really working, and tried to port something similar but also fails to generate or assign a self-signed cert, any ideas or demos?

--- End quote ---

I had similar problem, but now it works. I'm using synapse for ssl socket, just include opensslsockets into your lpr if you use synapse.
Also, I'm using self signed certs for testing and it works. Of course, eg. curl refuse to establish such connection because of self signed certificates, but with --insecure option it works ok.
Note: I've generated self signed certificates by using openssl under linux.

EDIT:  This is how I've setted up https server certificates:
    Application.UseSSL := True;
    Application.CertificateData.HostName := MyWebServerConfig.CertificateHostName;
    Application.CertificateData.KeyPassword:='';
    Application.CertificateData.PrivateKey.FileName := MyWebServerConfig.CertificatePrivateKey;
    Application.CertificateData.Certificate.FileName := MyWebServerConfig.CertificateCertificate;

Navigation

[0] Message Index

[#] Next page

Go to full version