Activating SSL / TLS in your Delphi 10.4 web server application

Programming Nation SSL Certificate Provider In Mumbai.

Until recently (pre Sydney 10.4) , you could activate SSL on any port (not just 443) on your Delphi web server application pretty easily by giving the cert and the key file along with the password event to the SSL IO handler object.

However, that has changed in the latest version. If you use the old code and recompile it with the new version on any other port other than 443, the web server simply won't respond to the request resulting in your browser saying that the server is 'taking too long to respond'.

To overcome that you need to modify the code to handle one more event in addition to the OnGetSSLPassword. That event is OnQuerySSLPort.

Here's how to do it. I am pasting a snip of the code because the lines of code to be added are trivial but the image is useful to point out where the changes have to take place:

Hope that helps.

Leave a Reply

Your email address will not be published. Required fields are marked *