Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2022-08

TFPHTTPServer and HTTPS

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Fabio Luis Girardi
Fabio Luis Girardi wrote
Exists in FPC some example that demonstrates the use of TFPHTTPServer with HTTPS? The unique example that I have found is about TCustomHTTPApplication.

There is no separate example.

Using https is just setting a property UseSSL := True, and include one of the
units that registers an SSL handler (opensslsockets or gnutlssockets)

What more do you need ?

Michael.

Reply by email

Fabio Luis Girardi
to Michael Van Canneyt

Hi Michael!

Thanks for replying so fast.

You're telling me that is possible, so the remaining possibility is that I have a problem in my environment. Last question: FPC 3.2.2 can do that or I have to use trunk version?

Sorry for taking your time.

Em ter., 23 de ago. de 2022 às 17:05, Michael Van Canneyt via fpc-pascal <

Show quoted text 24 lines
escreveu: On Tue, 23 Aug 2022, Fabio Luis Girardi via fpc-pascal wrote: > Exists in FPC some example that demonstrates the use of TFPHTTPServer > with HTTPS? The unique example that I have found is > about TCustomHTTPApplication. There is no separate example. Using https is just setting a property UseSSL := True, and include one of the units that registers an SSL handler (opensslsockets or gnutlssockets) What more do you need ? Michael. _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com

Reply by email

Ondrej Pokorny
to Fabio Luis Girardi

You need to set your certificate details as well:

   fServer.UseSSL := fUseSSL;
   if fUseSSL then
   begin
     fServer.CertificateData.KeyPassword := fCertificatePassword;
     fServer.CertificateData.HostName := fCertificateHostName;
     fServer.CertificateData.Certificate.FileName := fCertificateFileName;
     fServer.CertificateData.PrivateKey.FileName := fCertificatePrivateKey;
   end;

That should be sufficient. FPC 3.2.2 should do it.

Ondrej

Fabio Luis Girardi wrote 49 lines
Hi Michael! Thanks for replying so fast. You're telling me that is possible, so the remaining possibility is that I have a problem in my environment. Last question: FPC 3.2.2 can do that or I have to use trunk version? Sorry for taking your time. Em ter., 23 de ago. de 2022 às 17:05, Michael Van Canneyt via fpc-pascal escreveu: On Tue, 23 Aug 2022, Fabio Luis Girardi via fpc-pascal wrote: > Exists in FPC some example that demonstrates the use of TFPHTTPServer > with HTTPS? The unique example that I have found is > about TCustomHTTPApplication. There is no separate example. Using https is just setting a property UseSSL := True, and include one of the units that registers an SSL handler (opensslsockets or gnutlssockets) What more do you need ? Michael. _______________________________________________ fpc-pascal maillist  - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal -- The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com _______________________________________________ fpc-pascal maillist https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Fabio Luis Girardi
to Alexey Torgashin

Hi!

Thanks Ondrej! With your orientation I was able to make a TFPHTTPServer working with HTTPS with FPC 3.2.2

Em ter., 23 de ago. de 2022 às 18:34, Alexey Torgashin via fpc-pascal <

Show quoted text 11 lines
escreveu: > You need to set your certificate details as well: > fServer.UseSSL := fUseSSL; I just saved this info to wiki: https://wiki.freepascal.org/fphttpserver#Support_for_HTTPS _______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com

Reply by email